I want to create a NuGet package from a class library targeting .Net Framework 4.5 (not 4.5.1, or 4.5.2) which contains source code files, and I have trouble finding how.
The reason being that I would like to be able to debug it. I already created the symbols package, and it seems to works, provided I open the *.cs file I want to debug when VS2022 asks me for it.
To pack, I use a standard nuspec file, to which I specified the files I want to add taking inspiration from here
<contentFiles>
<files include="**\*.cs" buildAction="content" flatten="true" copyToOutput="true"/>
</contentFiles>
</metadata>
<files>
<file src="**\*.cs" target="src" />
</files>
All the files are sent to the .nupkg in a src folder, as expected.
The command I use to pack is
nuget pack *.csproj -Symbols -SymbolPackageFormat snupkg
I spent all day trying to figure out how to include source so that VS can find the source files after I install the package, to no avail. Any feedback would be appreciated.
Is there a way for this to be streamlined, or is uploading the file you want to debug the only option for 4.5?
Thanks!