Bug 30633 - Upgrading to Xamarin.Android 5.1.0 causes System.Deployment compile issues.
Summary: Upgrading to Xamarin.Android 5.1.0 causes System.Deployment compile issues.
Status: RESOLVED INVALID
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 3.11 (C5)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-01 11:01 UTC by Brad Chase
Modified: 2015-07-02 09:25 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED INVALID

Comment 2 Brad Chase 2015-06-01 11:17:51 UTC
I removed Microsoft.CSharp from the references and it seems to build but I am not sure because my License just ended today.  So instead of the previous error it gives me a size issue because of my expired license.  It seems it got further along.
Comment 3 Brad Chase 2015-06-01 11:30:19 UTC
Using a work mate's login I can compile with Microsoft.CSharp taken out.  Is this not needed any longer?
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2015-06-01 18:39:25 UTC
Many thanks for the test case! I believe this bug report will be very helpful for other users who might see the same problem after upgrading.


It appears the problem is in fact the reference to "Microsoft.VisualBasic". Similar to the suggestion in comment 2, I can stop the build error if I remove the reference to "Microsoft.VisualBasic".




Unlike all of the other assembly references in the project, "Microsoft.VisualBasic.dll" is referenced from the GAC:

> C:\Windows\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll




Assemblies in the GAC are (as far as I know) generally compiled against the desktop .NET profile. And this particular "Microsoft.VisualBasic" assembly from the GAC is indeed compiled against the desktop .NET 2.0 profile [1]. It is _not_ a Portable Class Library. As discussed briefly on [2], this scenario (using a _desktop_ .NET C# assembly in a Xamarin app) is _not_ intended to work.




[1] One of the assemblies referenced by "Microsoft.VisualBasic" is indeed the problematic "System.Deployment" version 2.0.0.0.



[2] "Xamarin.Android is not ABI compatible with existing assemblies compiled for a different profile..."

(http://developer.xamarin.com/guides/android/under_the_hood/assemblies/)




I will accordingly mark this bug as RESOLVED INVALID for now. But if you find that you start hitting the error again in the future, and you have double-checked that no desktop C# assemblies are referenced, feel free to add a new comment on this bug (or even better file a new bug report with the new test case and then leave a comment back on this bug). Thanks!