-
Notifications
You must be signed in to change notification settings - Fork 0
How To Share Nuget Packages Between Solutions
If you are working in a company there is always some libraries that are used between solutions / projects. Examples are the famous common lib, the mothership of all utilities (-: and Interfaces, Models and so one.
If one of those are using nuget the path to the nuget packages will be relative to the solution, and thats the problem. When you include the common in another solution, common can no longer find the nuget packages.
The solution to this is to place this NuGet.Config file in the root folder of you source tree
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="ThirdParty\Nuget" />
</config>
</configuration>
- root
- NuGet.Config
- ThirdParty
- Nuget
- ThirdParty
- Solution#1
- Solution#2
- Solution#3
- NuGet.Config
To make this work you must enable nuget restore for each solution, works best if you do it right after you have created a new solution. If you are using Git and of course you are (-: The you have to add this to the .gitignore file
# NuGet Packages Directory
packages
!packages/repositories.config