Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet exclude files from symbols package in nuspec

When doing a nuget pack against a .csproj file that has an accompanying .nuspec file, what is the syntax for excluding certain files from the symbols .nupkg?

For clarity, I do not want to exclude these files from the normal .nupkg, just from the symbols .nupkg. This is because SymbolSource fails to parse these files as managed assemblies.

Our workaround is to remove specific files from the symbols .nupkg after it has been created but it would be preferable to exclude them in some declarative fashion in either the .nuspec file or else in the package command.

like image 924
grenade Avatar asked Feb 12 '14 12:02

grenade


1 Answers

This might be abit of hack, but you could something like this:

nuget pack mypackage.nuspec -Symbols -Exclude "*/*.exe;*/*.dll"

Where "*/*.exe;*/*.dll" are the files you want to ignore and then run

nuget pack mypackage.nuspec

Where your mypackage.nuspec includes everything that you want in your regular nuget package.

This shouldn't cause any problems, since the dll, pdb and nuget packages should still have all matching versions.

like image 126
Simon Dickson Avatar answered Sep 29 '22 20:09

Simon Dickson