Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

StreamReader 'misused' as a type

$
0
0

I'm going through C# tutorials and have been alternating between several IDEs as I go.  SharpDevelop is my favorite so far, but I found a bug in it during one of the tutorials.  This isn't the tutorial's fault, as I throw the very same code into Visual Studio 2013 and it runs just as it's supposed to.

This is the troublesome line (squiggle under StreamReader):

 TextReader reader = new StreamReader("boop.txt");

The entirety of the code:

 TextReader reader = new StreamReader("boop.txt");
 string line = reader.ReadLine();
 Console.WriteLine(line);
 reader.Close();
 Console.ReadLine();

The problem is is that it won't build in SharpDevelop, and returns the following problem: 'StreamReader' is a 'namespace' but is used as a 'type' (CS0118)

The exact same code (copy-pasted) runs fine in Visual Studio.  This is the only error in the build.

Thanks.


Viewing all articles
Browse latest Browse all 1764

Trending Articles