I have a .net class library project (4.7.2) which will be built on an AzureDevops instance. In the build pipeline one step is to create a nuget package based on the corresponding *.csproj file. Within the class library project there are folders. Now when the nuget package is created the nuget package also contains the folders of the project and not only the created *.dll file. How can I avoid having the folders of the project in the created Nuget package?
Asked
Active
Viewed 68 times
0
-
Use a `.nuspec` file: https://stackoverflow.com/questions/14452608/how-to-exclude-a-folder-from-a-nuget-package – mm8 Sep 20 '19 at 11:23
1 Answers
0
To explicitly control which files are included in a package, you can specify files tag in .nuspec fule.
<files>
<file src="bin\Debug\*.dll" target="lib" />
<file src="bin\Debug\*.pdb" target="lib" />
<file src="tools\**\*.*" exclude="**\*.log" />
</files>
Check here for more information

Levi Lu-MSFT
- 27,483
- 2
- 31
- 43