I have a WPF project built on .Net Framework 4.8 and packaged using Windows Application Packaging Project. When I tried to upgrade it to .Net Framework 4.8.1 for ARM64 support, I am getting NU1201 error during Nuget restoration.
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362). Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
I have tried to trim everything down to a minimum reproducible repo here:
There are 2 tags:
netframework48andnetframework481
Their difference is switching over to ".Net Framework 4.8.1" in the project properties view:
On netframework48, run nuget restore .\WpfApp7.sln successfully restores the packages, while on netframework481, the same command fails with the following error message.
> nuget restore .\WpfApp7.sln
MSBuild auto-detection: using msbuild version '17.3.1.41501' from 'd:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin'.
Assets file has not changed. Skipping assets file writing. Path: D:\Work\temp\WpfApp7\WpfApp7\obj\project.assets.json
Restored D:\Work\temp\WpfApp7\WpfApp7\WpfApp7.csproj (in 69 ms).
Restoring packages for D:\Work\temp\WpfApp7\WpfApp7.Package\WpfApp7.Package.wapproj...
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362). Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-arm. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-arm-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-arm64-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x64. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x64-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x86. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x86-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
Assets file has not changed. Skipping assets file writing. Path: D:\Work\temp\WpfApp7\WpfApp7.Package\obj\project.assets.json
Failed to restore D:\Work\temp\WpfApp7\WpfApp7.Package\WpfApp7.Package.wapproj (in 500 ms).
Errors in D:\Work\temp\WpfApp7\WpfApp7.Package\WpfApp7.Package.wapproj
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362). Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-arm. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-arm-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-arm64-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x64. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x64-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x86. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NU1201: Project WpfApp7 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x86-aot. Project WpfApp7 supports: net481 (.NETFramework,Version=v4.8.1)
NuGet Config files used:
C:\Users\arieszhang\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.FallbackLocation.config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
https://api.nuget.org/v3/index.json
1 of 2 projects are up-to-date for restore.
Searched around but still did not figure out what this error exactly means? and how to fix this issue? In my project there is neither a project dependency nor a dependency from NetStandard to NetCoreApp as the definition of the error says.
I have tried every UWP target in the WpfApp7.Package properties, but the error remains regardless which min version selected, so I'm assuming the UWP target version is unlikely the cause.
Same question is also cross posted here: https://github.com/NuGet/Home/discussions/12206
Updates on 12 Nov 2022: There is a great answer in the above github issue. Please see it there: https://github.com/NuGet/Home/discussions/12206#discussioncomment-4082656.

