Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

use of XamlCompilation attribute leads to 'unable to resolve mscorlib' compliation warning #1958

@FrankChen021

Description

@FrankChen021

Description

if we add [XamlCompilation(XamlCompilationOptions.Compile)] to a Xamarin form to enable form compilation, a compilation warning shows that mscorlib conflicts as below:

unable to resolve “mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089” and “mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e” ...

Steps to Reproduce

it's very easy to reproduce this bug

  1. create a cross-platform app(Xamarin.Forms) project with the vs2017 wizard. choose Android platform, and use the .NET Standard share strategy.
  2. by default, the wizard creates a page named as MainPage, open MainPage.xaml.cs, add [XamlCompilation(XamlCompilationOptions.Compile)] to the MainPage class
  3. compile the android project, we get the warning. and the warning will disappear if we remove that attribute

Expected Behavior

no compilation warnings when XamlCompilation attribute is used for an android project.

Basic Information

  • Version with issue:

    currently, I use the latest version(2.5.0.280555), but this problem has been there at least since 2.4.0.280(I didn't check other versions before 2.4.0.280)

  • IDE: VS2017 on Windows 10

  • Platform Target Frameworks: Android

  • Android:

  • Android Support Library Version:
    Xamarin.Android.Support.Design Version="26.1.0.1"
    Xamarin.Android.Support.v7.AppCompat Version="26.1.0.1"
    Xamarin.Android.Support.v4 Version="26.1.0.1"
    Xamarin.Android.Support.v7.CardView Version="26.1.0.1"
    Xamarin.Android.Support.v7.MediaRouter Version="26.1.0.1"

Reproduction Link

below is the simplest project that can reproduce this problem

App1.zip

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions