How to create nuget package for native C++
I searched around for days until I found there is really no help out there on the internet at all. I did managed to piece together how to do it, and through trial and error got it working well. Which I have documented here:
https://digitalhouseblog.wordpress.com/2019/08/22/how-to-make-a-nuget-package-for-c/
But I'll summarize here anyways:
- Gather or stage your native library files into a folder of your choosing.
- Create a *.nuspec file in that folder.
- Edit the *.nuspec file to include the files you want to include in your package.
- Create a *.props file
- Call nuget pack to create the package.
- Push the nuget package to a feed somewhere.
- Create a packages.config file.
- Edit the visual studio project file to import the *.props file
Notice that the nuget tools inside the visual studio IDE are NEVER used. You have to do a LOT manually. See the link for full details and explanations.