Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using System.Xml.Linq with mono command line compilers

Tags:

xml

linq

mono

With the following code in C#/Mono,

using System.Xml.Linq;

I got this error.

 error CS0234: The type or namespace name `Linq' does not exist in the namespace `System.Xml'. Are you missing an assembly reference?

What assembly reference do I need to use System.Xml.Linq with mono?

dmcs /r:???? main.cs
like image 468
prosseek Avatar asked Nov 03 '10 14:11

prosseek


2 Answers

That would be:

dmcs -r:System.Xml.Linq.dll main.cs
like image 93
Jb Evain Avatar answered Nov 11 '22 11:11

Jb Evain


I received the same error when trying to load System.Xml.Linq in CSharpRepl.

You can specify the same command line argument as the first answer:

csharp -r:System.Xml.Linq.dll

Or you can load the assembly from within the REPL itself:

csharp> LoadAssembly("System.Xml.Linq.dll");
csharp> using System.Xml.Linq;
like image 37
afternoon Avatar answered Nov 11 '22 11:11

afternoon