开发者

Using System.Xml.Linq with mono command line compilers

开发者 https://www.devze.com 2023-01-23 12:59 出处:网络
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\

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

精彩评论

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