I have a few functions I want to make available to many projects I'm working on. So naturally I thought I should make a NuGet package to contain the shared code. so I:
- Created a class library (in this case called ADUserCacheUsage).
- Fixed the Assembly Info for that class library.
- went to the directory with
ADUserCacheUsage.csproj
, and in a command window didnuget spec
. This generated a.nuspec
file. - Fixed that nuspec file for my project.
nuget pack ADUserCacheUsage.csproj -Build -Symbols -Properties Configuration=Release
(after all, if someone externally is using the package, they only need the release build, right?)nuget add ADUserCacheUsage.1.0.0.nupkg -source "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages"
So great, my NuGet package shows up when I select the machine source in the package manager. So I can use it in my projects.
I'm making a sample web page to use it. All the sample does is call one function and output the result on a web page.
The problem is, whenever I try and run this sample project in debug mode, I get the warning message
You are debugging a Release build of ADUserCacheUsage.dll.
So presumably I should be including a debug version of my class library in my package, in addition to the release version, right? I wouldn't want the final release of the sample project to bother with the debugging information, potentially being slow and bloated (admittedly not much of an issue on a project that's just a sample, but I'm thinking for best practices and in the future where I might have a larger, more complex package).
But I want to be able to run in debug without this error. Whenever I make a web project, it includes many other projects, and it never gives me this error with regard to, for example, NewtonSoft.json
. So what should I be doing in order to do this the right way? Does every package on nuget.org just include the debug version?