Search code examples
nugetnuget-packagepackage-explorer

How are lib files referenced in Nuget Package Explorer


When I add a file to my Nuget package under the lib folder using the Nuget Package Explorer, I select the file via a standard file dialog. So I add all the files under the desired platforms... simple.

My question is, since there is nothing in the Nuget Package Explorer that tells me the source path of each file, do I have to re-add the files when I make changed to my files? For example, version 1.0.0 of "MyNugetPackage.nupkg" has a "net45" lib folder and 1 DLL, MyDll.dll. I make some changes to MyDll.dll and want to update MyNugetPackage to version 1.0.1. Do I have to delete the MyDll.dll from the net45 folder and re-add it? Do I need to create a whole new Nuget package? Or does the existing reference just point to the new MyDll.dll?


Solution

  • NuGet Package Explorer edits an existing .nupkg file which is basically a .zip file. If you change your dll then it will not automatically be included the .nupkg so yes you would need to add your dll again into the .nupkg if you are using NuGet Package Explorer.

    Instead I would look at using the NuGet pack command either with a .nuspec file or a project file (.csproj) which can be used to create a .nupkg file each time instead of manually editing the .nupkg in NuGet Package Explorer.