Reputation: 445
I'm trying to include the .pdb files in my NuGet packages to assist with debugging, but I can't seem to get it to work. I've added the following line to my .csproj file as recommended. It's in the same PropertyGroup as AssemblyName, OutputType, TargetFrameworkVersion, etc.
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
I'm using:
And have the following post build event:
nuget pack $(ProjectPath) -Prop Configuration=$(ConfigurationName)
nuget add $(ProjectName).@(VersionNumber).nupkg -source %PACKAGES_FOLDER%
I was using a nuspec file to get them in there, but this was messing with our build server.
All help appreciated.
Cheers Craig
Upvotes: 2
Views: 2403
Reputation: 445
Okay. I finally sorted out my NuGet issues. The following info may help others.
dotnet pack
instead of nuget pack
).I'm now using the following post build event in each of my projects:
del "$(ProjectDir)$(OutDir)*.nupkg"
$(SolutionDir)nuget pack $(ProjectPath) -symbols -Prop Configuration=$(ConfigurationName)
$(SolutionDir)nuget add $(ProjectName).@(VersionNumber).symbols.nupkg -source C:\Packages
The first line just removes previously generated .nupkg files that pile up in the build folder.
Upvotes: 1