[Mono-osx] Me, Mono and the C# compiler can't find the class HttpWebRequest...

Jonathan Pryor jonpryor at vt.edu
Fri Jan 28 13:30:34 EST 2011


On Dec 17, 2010, at 11:36 PM, black.box wrote:
> Ahem, thanks a lot, I located the problem...
> 
> I had to put "System" to the References. 
> (Whoever invented that - wots the point about that?)

As you professed a background in Java in another email message...

An assembly is akin to a .jar file (conceptually).

A `using` statement is akin to an `import` statement.

Note that the same Java package can be present in multiple .jar files; the same is true for namespaces in assemblies.

Consequently, when compiling C# code you need to provide both the namespace (in the C# source code, either via a `using` declaration or with fully-qualified type names) AND you need to specify the assembly that the type comes from (via the References tree in MonoDevelop, or via `mcs -r`).

The same is true for Java: you need to provide both the package name (either via an `import` statement or with fully-qualified type names) AND you need to include the .jar file in your $CLASSPATH or `java -classpath` option.

 - Jon



More information about the Mono-osx mailing list