开发者

Using System.Xml.Linq with mono command line compilers

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.X开发者_StackOverflow社区ml'. Are you missing an assembly reference?

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

dmcs /r:???? main.cs


That would be:

dmcs -r:System.Xml.Linq.dll main.cs


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜