Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 22805 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 7978 [details]
Removing references and then replacing them by adding NuGet packages does not appear to refresh the assembly resolver cache.
Related bug: https://bugzilla.xamarin.com/show_bug.cgi?id=22279
This might be a duplicate of bug 22279. The error messages are a little different in this particular test project. The attached test project does not produce the "Compiler crashed with code : 1" error, but I was able to produce that error using a slightly more complicated project from a user.
My only hesitation in marking it as a duplicate is that the problem described in this bug report can be solved by closing and reopening the project in Xamarin Studio.
## Steps to reproduce
1. Open the attached test case in Xamarin Studio and let NuGet restore the packages.
2. Control-click the "Newtonsoft.Json" reference under "Solution Pad -> References -> From Packages".
3. Select "Delete".
4. Control-click the "Newtonsoft.Json" package under "Solution Pad -> Packages".
5. Select "Remove".
6. Control-click the project name in the Solution Pad, and select "Add -> Add Packages"
7. Install the Json.NET NuGet package.
8. Build the project.
The special thing about the attached test case is that the HintPath for the Newtsonosft.Json reference is set to the "portable-net40"  version rather than the "portable-net45" version. Reinstalling the NuGet package at step 7 switches this reference to the default "portable-net45" version.
>  ..\packages\Newtonsoft.Json.6.0.5\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll
The build produces 13 "Error CS0012" errors. Cleaning and rebuilding the project does not stop the errors, but unloading and reloading the project _does_ stop the errors.
> Error CS0012: The type
> is defined in an assembly that is not referenced. Consider adding a
> reference to assembly `System.Runtime, Version=126.96.36.199,
> Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' (CS0012)
Close and reopen the project.
## Version information
Xamarin Studio Version 5.3 (build 441)
Git revision: befb6aa1176d37a5f678f4274f340a0159091b7a
Xamarin addins: 6dc7c388e31fdfc8014689839d37de0d4622435c
Mono 3.8.0 ((no/45d0ba1)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Android 4.16.0 (Business Edition)
Xcode 5.1 (5084), Build 5B130a
Mac OS X 10.9.4
Created attachment 7979 [details]
Diagnostic MSBuild ouput
xbuild doesn't seem to be expanding the facades.
My guess is that this has something to do with xbuild's internal dependency caches in the ResolveAssemblyReference task.
I'm seeing this bug as well, except that unloading and reloading the project or the solution is not fixing the issue. My .csproj references the portable-net45+wp80+win8+wpa81 version of Newtonsoft.Json.
## Version Information
Xamarin Studio Version 5.5.4 (build 15)
Mono 3.10.0 ((detached/92c4884)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Android Version: 188.8.131.52 (Business Edition)
Mac OS X 10.9.5