3

I am trying to package a custom UWP usercontrol into a nuget package. The project builds fine and works when used by a test app with a reference to the control.

I generated a .nuspec and I'm packaging the control via an Azure pipeline which then publish the package on our package source.

When trying to install the package on a blank UWP app in order to test it, the package installation fails and I get several NU1202 errors :

NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134). Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm. Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm-aot. Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-arm64-aot. Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x64. Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x64-aot. Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x86. Package ***** 1.0.14 does not support any target frameworks.
NU1202: Package ***** 1.0.14 is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134) / win10-x86-aot. Package ***** 1.0.14 does not support any target frameworks.

I guess it is a problem in the dependencies section of the .nuspec file but I can't find any clear answers about which dependencies I should include for this type of project.

Here's the dependencies and files sections of the .nuspec:

<dependencies>
      <dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.2.9" />
    </dependencies>
  </metadata>
  <files>
    <file src="bin\Release\*****.pdb" target="lib\uap10.0" />
    <file src="bin\Release\*****.pri" target="lib\uap10.0" />
    <file src="bin\Release\*****\*.*" target="lib\uap10.0\*****" />
   </files>

Thanks

Gambi
  • 31
  • 2
  • 1
    Hi, did you install this nuget package into a UWP project? The error shows that your current project is not compatible with nuget package.So please check whether you create a `class library(universal window)` for nuget. Besides, [clean the nuget cache](https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders#clearing-local-folders) before install this nuget package to check whether the old broken version of the nuget causes this behavior. – Nico Zhu Jan 23 '20 at 08:31

0 Answers0