19

I am using a NuGet package whose source code is on GitHub. I need to make a change in the source code and I know how to do it, however, I'm not sure how to make this change available to my project immediately. I guess the standard process is something like this:

  1. Fork the repo on GitHub
  2. Make the code change
  3. Open a PR
  4. Wait until the project maintainer merges it and publishes a new release on NuGet
  5. Run local NuGet update

The problem is step 4 which can take days or weeks (or forever). I am looking for a workflow in which I can bring the code change to my project immediately, without the wait for the maintainer, but I haven't worked with in the .NET / NuGet ecosystem for a while and have no idea how it should be done.

For example, should I publish a forked NuGet package on nuget.org? Should I create my own private feed? How? Where? Etc.

Borek Bernard
  • 50,745
  • 59
  • 165
  • 240

2 Answers2

7

Fork the repo, make the change and then use service like Appveyor or MyGet to host private packages of your fork.

Aleš Roubíček
  • 5,198
  • 27
  • 29
0

For a quick and dirty solution to this problem, I copied the DLLs from my fork of the NuGet package, added those DLLs to my project and updated my project references to use those instead. My project still has the reference to the original NuGet package (and all of its 3rd party dependencies), but now it also references DLLs in a local folder.

NJS
  • 426
  • 4
  • 15
  • If you mean that the project now has two references to the same DLL, one from the original NuGet package and the other one to your local build, I just tried this and the local DLL is ignored. So this isn't working. – ygoe Oct 17 '18 at 09:38
  • I'm not sure what you mean about two references to the same DLL. I changed my project references to use the forked DLLs instead of the nuget DLLs. For example, a reference in my csproj file changed from `..\packages\SomePackage.2.1.0\lib\net45\SomePackage.dll` to `MyForkedDlls\SomePackage.dll` – NJS Oct 19 '18 at 01:20
  • Ah, you're talking about old-style project files. I have a .NET Core project with direct package references. These are not made visible as assembly references anymore. – ygoe Oct 19 '18 at 07:00