0

One of the nuget packages that I am using have a minor problem that I have solved with a pull request. I would however want to include the fix in the build of my own application and I do not want to wait until the fix is released as part of a new version of the nuget package. Which procedure should I now follow to achieve this?

Can I keep my package reference and override the assembly provided by nuget with my own custom version of the assembly? I have tried to just copy the custom assembly to the corresponding location in nuget packages folder but it does not work.

Do I have to remove the nuget package reference and keep the custom library in my version control until the fix gets released?

Magnus Lindhe
  • 7,157
  • 5
  • 48
  • 60

1 Answers1

0

Especiall when you're working with a team or using a build server, you'll want to not do an in-place replace of the same package version.

You can either add a direct reference to the custom-built assembly (and be sure to version it or to include the source in source control so your colleagues or the build server can compile it themselves), or create a new NuGet package with a higher version number and upgrade to that version.

If you don't have a private NuGet server, you can simply add a (shared) directory as package source for your custom built package, as explained in How to install a Nuget Package .nupkg file locally?.

It may work with the same package version, but then you'll have to remove and reinstall it, and make sure it isn't cached anywhere so the old package won't simply be added again. So you better just change the version number.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272