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

How do i remove dll(s) from Nuget package?

$
0
0

Im using Visual Studio 2022 and created a Nuget Package using this article

https://arsenshnurkov.github.io/gentoo-mono-handbook/building-nupkg.htm

I run nuget pack and i see the nupg file and upload it to our Azure Artifacts. Below is the spec file

<package ><metadata><id>myProject.csproj</id><version>1.0.0</version><authors>user</authors><owners>user</owners><requireLicenseAcceptance>false</requireLicenseAcceptance><description>Test package 1</description><releaseNotes>Summary of changes.</releaseNotes><copyright>Copyright 2023</copyright><tags>Tag test</tags></metadata></package>

I noticed when i install this pack into a test application it includes some dlls that are not required for the end project to run.

After some research there are suggestions to change the .csproj to exclude it from Nuget when packing following this article https://www.jocheojeda.com/2019/07/22/how-to-exclude-package-dependencies-in-a-nuget-package/

but he writes the exact question i have in mind but no example of how to do this. In the article he quotes

the answer depend on how now you create your NuGet package, in this case, I’m going to focus my answer on excluding the dependency in a package created by the info in the csproj file (there is a different approach if you use the nuspec file).

I dont want to amend the csproj file but just the nuspec file. How could i leave out files that i dont want to have bundled with my package by amending the nuspec file?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



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