什么是 Json.NET Mono 程序集参考? [英] What is the Json.NET Mono assembly reference?
问题描述
我正在尝试编译这个 Json.NET 代码:
I am trying to compile this Json.NET code:
using Newtonsoft.Json;
...
MyDesc d = JsonConvert.DeserializeObject<MyDesc>(jsonInput);
...
通过单声道使用此命令(在 ubuntu 上):
with this command via mono (on ubuntu):
$ mcs Main.cs -lib:/home/username/JsonNET/Net40/Newtonsoft.Json.dll
但我收到无程序集参考"-错误:
But i am getting "no assembly reference"-error:
error CS0246: The type or namespace name `Newtonsoft' could not be found.
Are you missing an assembly reference
什么是正确的 Json.NET Mono 组件引用?
What is the correct Json.NET Mono assebmly reference?
(-lib 选项看起来很合适,但它不起作用 -lib:PATH1[,PATHn] 指定引用程序集的位置
)
(-lib option looks right for this, but it does not work -lib:PATH1[,PATHn] Specifies the location of referenced assemblies
)
推荐答案
引用其他程序集的mono编译器命令是-r:PATH/TO/ASSEMBLY
.您应该尝试使用当前版本的单声道.
The mono compiler command to reference other assemblies is -r:PATH/TO/ASSEMBLY
. You should try this with the current version of mono.
$ mcs Main.cs -r:/home/username/JsonNET/Net40/Newtonsoft.Json.dll
参考:http://linux.die.net/man/1/mcs 或者在你的 shell 中输入:
Reference: http://linux.die.net/man/1/mcs or type into your shell:
$ man mcs
这篇关于什么是 Json.NET Mono 程序集参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!