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 on
Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 7930 [details]
project references Newtonsoft.json.dll, fails to build in VS succeeds in XS
After updating Xamarin for Visual Studio to v18.104.22.168 and my Mac Build Host to: Xamarin Studio v. 5.3 (build 440) and Xamarin.iOS 22.214.171.124, my iOS projects fail to build with:
DEBUG error: C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Could not AOT the assembly '…/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll'
DEBUG build output: Missing method System.Runtime.InteropServices.Marshal::GetNativeVariantForObject<>(!!0,intptr) in assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/mscorlib.dll, referenced in assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll (TaskId:1983)
RELEASE error: C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Failed to resolve "System.Reflection.Emit.ModuleBuilder" reference from "mscorlib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089"
I believe I have reduced (at least some component of) the issue to the reference to Newtonsoft.Json.dll. I am using the latest from NuGet: Newtonsoft.Json.6.0.4\lib\portable-net45+wp80+win8+wpa81.
Attached is a project that will fail with "Failed to resolve "System.Reflection.Emit.ModuleBuilder" reference from "mscorlib"" when build from VS, but succeeds to build from XS on Mac. Presumably this would have built on the previous VS version.
Related forum thread with other users hitting similar issues: http://forums.xamarin.com/discussion/comment/74319#Comment_74319
I have checked this issue and able to reproduce it.
I have tried following steps to reproduce it.
1.Followed above bug description.
2.Build the solution.
I observed that when i build attached project throws an exception of System.Reflection.Emit.ModuleBuilder But issue was resolved when I followed following Steps
1. Go to "Configuration Manager" in bottom of drop down "Debug"
2. Set Platform iphone to iphoneSimulator.
3. Go to properties of project by Rightclick of project then properties.
4.Select ios Application in LeftPane
5. Set Deployment target to 5.0
6.Save Project and build.
Screencast regarding same: http://screencast.com/t/Fx4mQoUC
Let me know if still you are facing this issue.
VS Professional 2012
I have verified that I can build using your steps, but I don't understand how they could be considered a satisfactory solution. I target specific iOS versions and iPhone device for a reason, and building against those targets just stopped working due solely to the latest update.
This is a major wrench in my productivity - In the meantime are there supported options for me to revert back to an earlier build?
This problem disappeared for me when I updated to Xamarin Version 5.3 (build 441). I saw a release note that could have been involved, or perhaps this was some type of install issue with the previous update. I've seen many complaints about this issue, I'm assuming it is resolved.