I'm trying to update this NuGet UWP library but since I switched to the UWP SDK 17134 (both as minimum and target version), it seems like all the PackageReference
I have get lost during the packaging process.
As a result NuGet just shows "no dependencies", and the packages used by the lib are not automatically restored when using it in another application/library.
This all used to work perfectly fine up until the SDK 16299, and it still does when targeting that SDK. The issue only seems to happen with SDK 17134 or greater.
Also, I'm using NuGet version 4.7.0.5148
.
This is how the .csproj file look like:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...
</PropertyGroup>
<ItemGroup>
<Compile Include="SomeSampleCodeFile.cs" />
...
<EmbeddedResource Include="Properties\UICompositionAnimations.rd.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations">
<Version>2018.2.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.1.5</Version>
</PackageReference>
<PackageReference Include="Win2D.uwp">
<Version>1.23.0</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>
I usually just build the package in Release mode, Any CPU from VS, then call:
nuget pack ProjectName.csproj -Prop Configuration=Release
to build the NuGet package to upload.
NOTE: I noticed that when switching from SDK 16299 to 17134, VS switched from using the project.json
file for the references, to just including the various PackageReference
items directly into the .csproj file, and I guess NuGet didn't like that. Is there something I have to do to specifically enable this for a UWP library? I mean, I do have other NuGet libraries targeting .NET Standard that work just fine with PackageReference
items
I'm not sure what I'm doing wrong here, or if I'm supposed to add something to make those references come back when targeting this new SDK.
Thanks for your help!