Bug 55573 - XamlCompilation causes mscorlib version conflict
Summary: XamlCompilation causes mscorlib version conflict
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Stephane Delcroix
Depends on:
Reported: 2017-04-25 16:38 UTC by Edward Brey
Modified: 2017-04-25 19:26 UTC (History)
2 users (show)

Tags: xamlc
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 for Bug 55573 on Developer Community or GitHub 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 original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Edward Brey 2017-04-25 16:38:06 UTC
When XamlCompilation is enabled, the build output warns of a conflict between the MonoAndroid and .NET versions of mscorlib.

* VS2017
* Xamarain.Android SDK
* JDK: 1.8.0_112 (latest installed via VS2017)
* Android NDK: r13b (latest installed via VS2017)
* Android SDK: 7.1 (latest installed via Android Studio)


1. Create new project: Blank App (Android)

2. Install-Package Xamarin.Forms -DependencyVersion Highest

3. Add this line to MainActivity.cs before the namespace:
[assembly: Xamarin.Forms.Xaml.XamlCompilation(Xamarin.Forms.Xaml.XamlCompilationOptions.Compile)]

4. Build


This warning appears:
No way to resolve conflict between "mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
Comment 1 Edward Brey 2017-04-25 17:00:57 UTC
Forgot a repro step:
3.1. Add a new "Forms Blank Content Page Xaml" item to the project.