I am trying to compile this Json.NET code:
using Newtonsoft.Json;
...
MyDesc d = JsonConvert.DeserializeObject<MyDesc>(jsonInput);
...
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
What is the correct Json.NET Mono assebmly reference?
(-lib option looks right for this, but it does not work -lib:PATH1[,PATHn] Specifies the location of referenced assemblies
)
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
Reference: http://linux.die.net/man/1/mcs or type into your shell:
$ man mcs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With