0

There is one shared solution which uses packages (obtained via nuget, for example Elmah). This solution generates DLLs.

I have several solutions which want to use those dlls. I've added them via "Add reference".

This works when I have my nuget packages installed on every solution, but when i uninstall it from the descendant - it can't find it. I understand why (it does not copy folder with packages from sharedSolution, only generated DLLs), but I wonder what is best practice in such situation?

Tariktiri
  • 149
  • 1
  • 10

1 Answers1

0

If you prefer to manage the DLLs shared across multiple solutions manually, the steps would be:

  1. After loading the NuGet package to one of your solutions, navigate to the package location and copy all the required DLLs (with the supporting XML files, if any) to a separate folder (e.g. Vendors\SharedPackage.Version1).
  2. Uninstall the NuGet package.
  3. Now using "Add reference", navigate to the location where you copied the SharedPackage in step 1 (Vendors\SharedPackage.Version1 folder) and add the required reference to all projects and solutions you want.

Note: If you go down this path, you'll have to manage all the SharedPackage updates manually: Get the updated package via NuGet, copy the package contents to a separate folder (Vendors\SharedPackage.Version2), uninstall the package, remove references to the old package from all your projects in all solutions, add references to the new version of the SharedPackage.


Alternatively, if you want to have your NuGet packages managed by the Visual Studio, this thread is the best source of information I could find on this topic. Vermis has done a great research work!

P.S. Imho, the manual solution is easier to implement but harder to maintain. The decision is up to you.

Alex X.
  • 453
  • 5
  • 11
  • I thought about the first solution, but I didn't like it. Thank You very much for clear and constructive answer! – Tariktiri Oct 26 '17 at 12:16
  • Glad you found my post useful. Stay tuned with the VS and NuGet updates: sometimes they release new features that make our life easier. – Alex X. Oct 27 '17 at 13:06