NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 250 forks source link

Windows runtime component is not compatible with uap10.0 #5929

Open Waynext opened 6 years ago

Waynext commented 6 years ago

Details about Problem

After adding a Runtime Component into Xamarin.forms solution and reference it from UWP project, I can not install package anymore in UWP project. It says "Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0). Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0. Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0) / win10-arm. Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0 (win10-arm). Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0) / win10-arm-aot. Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0 (win10-arm-aot). Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x64. Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0 (win10-x64). Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x64-aot. Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0 (win10-x64-aot). Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x86. Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0 (win10-x86). Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x86-aot. Project RuntimeComponent1 supports: uap10.0.10586 (UAP,Version=v10.0.10586) One or more projects are incompatible with UAP,Version=v10.0 (win10-x86-aot). NuGet package restore failed."

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):VS UI

NuGet version (x.x.x.xxx):4.2.0

dotnet.exe --version (if appropriate):4.7.02046

VS version (if appropriate):Version 15.2 (26430.16) Release

OS version (i.e. win10 v1607 (14393.321)): win10 v1703(15063.540)

Worked before? If so, with which NuGet version:

Detailed repro steps so we can see the same problem

1.Create a new cross platform solution, .i.e Xamarin.forms and portable class library

2.Add windows runtime component, which is used for supporting uwp background task.

3.Refer to the component in UWP project

  1. Build UWP project or install any package through Manage Nuget Packages

Other suggested things

Verbose Logs

Please include verbose logs (NuGet.exe -verbosity detailed | dotnet.exe --verbosity diag | etc...)

Sample Project

AppFormTest.zip

Very helpful if you can zip a project and paste into this issue!

rrelyea commented 6 years ago

In VS 2017 version 15.3, we did some work to do the following: 1) NuGet now knows about UAP10.0.XXXXX -- where XXXXX is the WIndows 10 build number. 2) NuGet will now take XXXXX from TargetPlatformMinVersion (from csproj) and treat that as the TFM. 3) For project.json based projects, NuGet in VS 15.3 will now modify project.json from TFM of UAP10.0 to UAP10.0.XXXXX.

Please try this out in 15.3.5 or later, and let us know how it goes.

DHowett-MSFT commented 6 years ago

One of our consumers over at WinObjC is hitting this during a nuget.exe restore on VS 15.6.

I can reproduce it with the following configuration:

(dhowett-dev) ~\Downloads\Dll1 % e:\src\winobjc\.tools\nuget restore Dll1.sln
NuGet Version: 4.5.1.4879
MSBuild auto-detection: using msbuild version '15.6.82.30579' from 'C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\bin'.
Restoring packages for C:\Users\duhowett\Downloads\Dll1\RuntimeComponent1\RuntimeComponent1.csproj...
Restoring packages for C:\Users\duhowett\Downloads\Dll1\Dll1\project.json...
NU1201: Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0). Project RuntimeComponent1 supports: uap10.0.14393 (UAP,Version=v10.0.14393)
Committing restore...
Writing lock file to disk. Path: C:\Users\duhowett\Downloads\Dll1\Dll1\project.lock.json
Restore failed in 304.71 ms for C:\Users\duhowett\Downloads\Dll1\Dll1\Dll1.vcxproj.
Committing restore...
Generating MSBuild file C:\Users\duhowett\Downloads\Dll1\RuntimeComponent1\obj\RuntimeComponent1.csproj.nuget.g.props.
Generating MSBuild file C:\Users\duhowett\Downloads\Dll1\RuntimeComponent1\obj\RuntimeComponent1.csproj.nuget.g.targets.
Writing lock file to disk. Path: C:\Users\duhowett\Downloads\Dll1\RuntimeComponent1\obj\project.assets.json
Restore completed in 2.95 sec for C:\Users\duhowett\Downloads\Dll1\RuntimeComponent1\RuntimeComponent1.csproj.

Errors in C:\Users\duhowett\Downloads\Dll1\Dll1\Dll1.vcxproj
    NU1201: Project RuntimeComponent1 is not compatible with uap10.0 (UAP,Version=v10.0). Project RuntimeComponent1 supports: uap10.0.14393 (UAP,Version=v10.0.14393)

The project.lock.json for Dll1 and Lib1 contains UAP,Version=v10.0 after restore.

mishra14 commented 6 years ago

@DHowett-MSFT Are you still running into this with VS 15.7.4?

DHowett-MSFT commented 6 years ago

Yes. With the exact same error message.

JKennedy24 commented 6 years ago

I am also seeing this error

DHowett commented 5 years ago

jeopardy music plays

And now I'm still running into problems like this with 15.8 and 15.9. It looks like vcxproj is the unloved step-child in the MSBuild project system.