One more problem when compiling v3 samples - I am getting the error below. Any idea how to workaround? Perhaps using Newtonsoft.Json.dll sources?
Error 172 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Newtonsoft.Json, Version=184.108.40.206, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Newtonsoft.Json.dll'
at Monodroid.Tuner.MonoDroidResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute() TestOne
I've seen this on one customer machine
Not sure what is causing it, and customer was too non-technical to help.
Basically, something in your VS setup is forcing CopyLocal for the PCL newtonsoft.json to false
If you set it to true, then it will compile - but I'd like to identify why it is being forced to false. Can you see any reason?
Good hint. I've created a new android app within your solution and referenced CrossCore, CrossCore.Droid, MvvmCross, MvmCross.Binding, MvmCross.Binding.Droid MvvmCross.Droid and MvmCross.Plugins.Json.
Initially I got that error but once I set CopyLocal=true for NewtonSoft.Json.dll in MvmCross.Plugins.Json references the error went away.
However it still remains for samples. WIll do some more tests.
I did think it was maybe due to something from MS (or from Xam?) installing a copy of Newtsonsoft in the GAC - but I didn't get to the bottom of it.
There may be some setting to force CopyLocal in the project file - but VS and XS seemed to fight me :/
If I have an empty project and reference Json it will work but as soon as I call one of its methods it would file at compile time.
Looks like compiler ignores it if not need (makes sense).
Solved by adding Newtonsoft.Json sources instead of referencing the library.
Any idea if there is any flag I can put in the csproj file to force it to copy local? Maybe I need to set the Specific Version? (although that would suck)
Click on reference, CopyLocal=true in reference properties. That's it. It don't think it is related to specific version in any way. But even when copied locally the problems persisted for me.
The good news (sad news) is that Newtonsoft is not really needed for quite a lot of samples now....
The bad news is that I think this property still isn't persisted correctly in the project settings...
So leaving this open for now...
I don't believe this as much of a problem any more - certainly not in this repo anyway.
Closing this - hopefully it's covered by the new nuget approach.
If not then I'm sure it will reopen...
I'm still receiving the issue, even while utilizing "Copy Local" to "True" as well as referencing it from nuget. Am I doing something wrong that no one else has commented on this in nine months?
I get this error as well
if you get this issue, uncheck "Local Copy" and Recheck it, it seems to be a bug with the default value. It should work at least withing Xamarin Studio