Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting uap in a multi-targeting library breaks in-IDE restore and build #237

Open
AArnott opened this issue Aug 17, 2020 · 2 comments
Open

Comments

@AArnott
Copy link
Collaborator

AArnott commented Aug 17, 2020

Given a class library with:

<Project Sdk="MSBuild.Sdk.Extras">

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;uap10.0.17763</TargetFrameworks>
  </PropertyGroup>

</Project>

And a global.json with:

{
  "msbuild-sdks": {
    "MSBuild.Sdk.Extras": "2.1.2"
  }
}

The build at the command line is ok, although it produces a few warnings. But the IDE is totally shot. It claims fatal nuget restore errors:

1>------ Build started: Project: UWPTargetingTest, Configuration: Debug Any CPU ------
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>C:\Users\andarno\.nuget\packages\msbuild.sdk.extras\2.1.2\Sdk\Sdk.props(25,3): warning MSB4011: "C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props (134,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj]
1>C:\Users\andarno\.nuget\packages\msbuild.sdk.extras\2.1.2\Sdk\Sdk.props(25,3): warning MSB4011: "C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props (134,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj]
1>C:\Users\andarno\.nuget\packages\msbuild.sdk.extras\2.1.2\Sdk\Sdk.props(25,3): warning MSB4011: "C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.props (134,3)". This is most likely a build authoring error. This subsequent import will be ignored. [C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj]
1>You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0). Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-arm. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-arm-aot. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-arm64-aot. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-x64. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-x64-aot. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-x86. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\UWPTargetingTest.csproj : error NU1202: Package System.Numerics.Vectors.WindowsRuntime 4.0.1 is not compatible with netcore50 (.NETCore,Version=v5.0) / win10-x86-aot. Package System.Numerics.Vectors.WindowsRuntime 4.0.1 supports: uap10.0 (UAP,Version=v10.0)
1>Done building project "UWPTargetingTest.csproj" -- FAILED.
1>C:\Program Files\dotnet\sdk\5.0.100-preview.8.20412.11\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file 'C:\Users\andarno\source\repos\UWPTargetingTest\UWPTargetingTest\obj\project.assets.json' doesn't have a target for 'UAP,Version=v10.0.17763'. Ensure that restore has run and that you have included 'uap10.0.17763' in the TargetFrameworks for your project.
1>Done building project "UWPTargetingTest.csproj" -- FAILED.
1>Done building project "UWPTargetingTest.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If I add an SDK pin to the global.json:

{
  "msbuild-sdks": {
    "MSBuild.Sdk.Extras": "2.1.2"
  },
  "sdk": {
    "version": "3.1.302"
  }
}

Then the build warnings at the CLI go away, but VS is still just as broken.

AArnott added a commit to AArnott/PCLCrypto that referenced this issue Aug 17, 2020
This makes a couple tests fail on UWP because UWP is consuming the netstandard2.0 build of the library. Adding a uap10.0 target hits novotnyllc/MSBuildSdkExtras#237.
@clairernovotny
Copy link
Collaborator

Did this just start happening? This used to work and I wonder if something in the SDK or VS broke.

@AArnott
Copy link
Collaborator Author

AArnott commented Sep 8, 2020

I don't know when it might have worked in the past. I only recently picked up this project after several years and wanted to modernize it with uap support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants