Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Nuget Package Resulting in csproj Elements That Prevent Build

$
0
0

I'm running into a problem building a Nuget package with Nuget Package Explorer.

I created the package and uploaded it to Nuget.org

When I installed it in an application, 2 elements which were unknown to me (PrivateAssets and IncludeAssets) were included in the csproj file for the test project I created:

<PackageReference Include="myPackage" Version="1.0.0-rc.1"><PrivateAssets>all</PrivateAssets><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets></PackageReference>

This was preventing me from using the library at all (dll not resolving) and it would not build.

When I modified that, as follows, I was able to reference the library and everything worked:

<PackageReference Include="myPackage" Version="1.0.0-rc.1" />

The nuspec file which was in the nupkg container is:

<?xml version="1.0" encoding="utf-8"?><package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"><metadata><id>MyPackage</id><version>1.0.0-rc.1</version><title>MyPackage</title><authors>Some Name</authors><owners>Some Name</owners><developmentDependency>true</developmentDependency><requireLicenseAcceptance>false</requireLicenseAcceptance><licenseUrl>https://github.com/name/MyPackage/blob/main/LICENSE</licenseUrl><projectUrl>https://github.com/name/MyPackage</projectUrl><iconUrl>http://www.gravatar.com/avatar/6732fvghjdsa3d9f025201ce7</iconUrl><description>MyPackage is a ....</description><summary>A ....</summary><releaseNotes>This ....</releaseNotes><copyright>Some Name</copyright><language>en-US</language><tags>Tag1, Tag2</tags><dependencies><dependency id="Microsoft.Extensions.Logging" version="5.0.0" /><dependency id="Microsoft.Extensions.Logging.Abstractions" version="5.0.0" /></dependencies></metadata></package>

Anyone got any idea what is wrong?

Is it because developmentDependency is set to true? (That's my hunch).


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>