dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.22k stars 1.35k forks source link

UAP and netcore3.0 targeting conflict #4411

Closed Rmurray0809 closed 5 years ago

Rmurray0809 commented 5 years ago

Steps to reproduce

Adding Both UAP and netcoreapp3.0 to the targetframeworks causes UAP to to fail with an error about libraries not being able to target netcore50

Project file

<Project>
  <Sdk Name="MSBuild.Sdk.Extras" Version="2.0.24" />
  <PropertyGroup>
    <TargetFrameworks>netstandard1.1;net45;uap10.0.16299;Xamarin.iOS10;MonoAndroid80;netcoreapp3.0</TargetFrameworks>
    <!--<TargetFrameworks>net45;Xamarin.iOS10;MonoAndroid80;netstandard2.0;netcoreapp3.0</TargetFrameworks>-->

    <PackageId>Caliburn.Micro.Core</PackageId>
    <Product>Caliburn.Micro Core</Product>
    <RootNamespace>Caliburn.Micro</RootNamespace>
  </PropertyGroup>

  <PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
    <AssemblyOriginatorKeyFile>.\..\Caliburn.Micro.snk</AssemblyOriginatorKeyFile>
    <SignAssembly>true</SignAssembly>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
    <PackageReference Include="System.Numerics.Vectors.WindowsRuntime" Version="4.3.0" />
  </ItemGroup>

  <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
    <PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
  </ItemGroup>

  <ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid'))">
    <Reference Include="System.Runtime.Serialization" />
  </ItemGroup>

  <ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
    <Reference Include="System.Runtime.Serialization" />
  </ItemGroup>

</Project>

Directory contents: Is occuring while trying to add Core 3.0 support to Caliburn Micro, My fork with the current code is at: https://github.com/Rmurray0809/Caliburn.Micro

Output

error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.3.0 is not compatible with netcore50 (.NETCore,Version=v5.0). Package System.Numerics.Vectors.WindowsRuntime 4.3.0 supports: uap10.0 (UAP,Version=v10.0)

Environment data

16.2.0-preview.19264.2+c3389964c

OS info: Windows 10 Pro

VS16.2.0 Preview 1

rainersigwald commented 5 years ago

The UAP TargetFramework is something that https://github.com/onovotny/MSBuildSdkExtras adds; it's not supported by Microsoft or by core MSBuild. Please file an issue on MSBuildSdkExtras.

davkean commented 5 years ago

This particular issue was fixed with https://github.com/dotnet/project-system/issues/4854 and is in 16.1.2, but I want to reiterate that MSBuild.Sdk.Extras is not supported by Microsoft.