A trivial C# program:
using System;
using System.IO;
public class HelloWorld {
static public void Main () {
Console.WriteLine ("Hello World!");
Streamreader sr = new Streamreader();
}
}
My program, above, results in the following error.
Compilation failed: 1 error(s), 0 warnings
main.cs(7,7): error CS0246: The type or namespace name `Streamreader' could not
be found. Are you missing an assembly reference
How does one add an assembly reference?
C# Assembly Reference
Re: C# Assembly Reference
Maybe you need to use: StreamReader instead of Streamreader
-
- Posts: 3
- Joined: Fri Apr 08, 2022 12:10 am
Re: C# Assembly Reference
Thanks for the reply. A really basic mistake on my part.
I've made the correction: Streamreader to StreamReader in both cases.
Now the error is
Compilation failed: 1 error(s), 0 warnings
main.cs(7,19): error CS0122: `System.IO.StreamReader.StreamReader()' is inaccessible due to its protection level
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Further suggestions? Thanks in advance.
I've made the correction: Streamreader to StreamReader in both cases.
Now the error is
Compilation failed: 1 error(s), 0 warnings
main.cs(7,19): error CS0122: `System.IO.StreamReader.StreamReader()' is inaccessible due to its protection level
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error)
Further suggestions? Thanks in advance.
-
- Posts: 3
- Joined: Fri Apr 08, 2022 12:10 am
Re: C# Assembly Reference
jpconver,
Please disregard my most recent reply/question. Immediately after submitting, I realized that streamreader has no constructor with zero arguments.
I'm having so much fun learning to use Browxy that I'm not thinking about the language.
Please disregard my most recent reply/question. Immediately after submitting, I realized that streamreader has no constructor with zero arguments.
I'm having so much fun learning to use Browxy that I'm not thinking about the language.