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 or GitHub 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 6564 [details]
The solution is attached to demonstrate the problem.
I made a demo solution to demonstrate the bug. I have other bugs to file into
bugzilla so the solution contains several issues to reproduce at once.
In order to compile it, the NuGet 2.8.1 (means MrWard Version 0.9) Add-In
should be installed into Xamarin.Studio. It should be taken from this URL:
as described here:
Therefore before building the solution all NuGet packages should be restored
for the main and libarary projects.
So the solution as is can be successfully built and run in iPhone Simulator, but when you try to run it on an iPhone it produces compilation error:
Error MT2002: Failed to resolve "System.Void System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(System.String)" reference from "System.Runtime, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" (MT2002) (Bugs)
There is a discussion about the same error here: http://forums.xamarin.com/discussion/13213/deploying-to-device-fails-for-ios-project-from-vs2013. But the offered solution there doesn't help in my case.
By offered solution that didn't help I meant setting "Copy Local" to False to all System.* referenced libs in portable library and the main project.
Please add "-v -v -v -v" to your project's configuration (under "mtouch additional arguments"), do a clean and then build again. Attach the full build log to the bug report.
Also include your complete version information about the softwarare you're presently using.
The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Created attachment 6567 [details]
About Environment Info
Created attachment 6568 [details]
Full Build Log
The attached build log did not include the "-v -v -v -v" arguments - but I was able to duplicate the issue.
Copied /Users/sebastienpouliot/Downloads/Bugs-Solution/packages/Microsoft.Bcl.1.1.8/lib/portable-net40+win8/System.Runtime.dll to /Users/sebastienpouliot/Downloads/Bugs-Solution/Bugs/obj/iPhone/Debug/mtouch-cache/Link/System.Runtime.dll
So the System.Runtime.dll facade assembly (shipped with XI) is not being used.
I'm not sure if there are known issues (or specific requirements) for PCL with NuGet. c.c. Martin and Matt
Created attachment 6569 [details]
The Full Build Log
Sorry, the last build log indeed was not full. (I set -v-v-v-v for debug mode and switched to release one before building...)
That's not a bug, you're using an unsupported combination of frameworks and NuGet packages.
Changing this from Profile 158 to 78, then reinstalling all those NuGet packages could help.
Thanks for your feedback! Indeed I could change profile to 78. Initially I stuck on compilation issues with reflection code due to changes in .net4.5 (so I used profile158) but I just finished a refactoring and I could run my solution with PCL on profile 78 and the mentioned in this bug problem was fixed.
Although it's really confusing that it was working in iPhone Simulator but didn't on real iPhone. I bet this will confuse other people to, so maybe there could be some improvements applied to make the development more consistent.
So overall your advise pretty much helped to move forward, but I couldn't get my thing working after all. It seems that running RestSharp.Portable in PCL on Xamarin is not possible at the moment. Due to the bugs in Xamarin or RestSharp.Portable?
I could file another bug with steps and description of the problem: again it works in Simulator but doesn't work on iPhone. This time the problem with different versions of System.Net.Http that comes as a dependency for RestSharp.Portable NuGet Package referencing Microsoft HTTP Client Libraries. Does it worth it to create a bug or it's a known issue?
People are talking about this at Forums: https://forums.xamarin.com/discussion/14919/sending-http-requests-from-xamarin-portable-class-library