I have the following project file:
<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net6.0</TargetFramework></PropertyGroup><ItemGroup><PackageReference Include="Newtonsoft.Json" Version="13.0.1" /></ItemGroup></Project>
If I run the msbuild /t:pack on this project, the resultant nuspec will have the follwoing dependency group:
<group targetFramework="net6.0"><dependency id="Newtonsoft.Json" version="13.0.1" exclude="Build,Analyzers" /></group>
I need "exclude" to not have "Build". I tried changing Netwonsoft.Json reference to
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" IncludeAssets="build" />
but it resulted in:
<group targetFramework="net6.0"><dependency id="Newtonsoft.Json" version="13.0.1" exclude="Runtime,Compile,Build,Native,Analyzers,BuildTransitive" /></group>
Not even close to what I expected. How do I achieve the desired result, and, more importantly, how do PackageReference IncludeAssets/ExcludeAssets/PrivateAssets get mapped to nuspec include/exclude?