Nuget restore for dependent projects
I have multiple projects in a added in multiple solutions and at different directory levels. I use packages.config to maintain list of dependencies. On nuget restore for a solution through command line, packages folder is created in the same directory as solution file and gets all dependencies are downloaded. Now there are some projects added as reference which are also present in other solutions. So projects refer different packages folder. On restore only 1 packages folder is created and so some projects referring packages at other location, do not get their packages restored.
Is there any way one can get all dependencies in multiple packages folder in different directories?
You can create a NuGet.Config file with a repositoryPath
which overrides the default behaviour.
<configuration>
<config>
<add key="repositoryPath" value="packages" />
</config>
</configuration>
The path is relative to where the directory the NuGet.Config file exists.
Note that the location of the NuGet.Config file should be in a directory that is the same or above the solutions. Whilst you can have multiple NuGet.Config files, it will probably be simpler to have one at the root directory of your solutions. For example:
Also note that you would need to reinstall the NuGet packages in the projects, or at least fix the reference paths, since they will now be using a different packages directory and will be incorrect.
链接地址: http://www.djcxy.com/p/62284.html上一篇: Facebook喜欢Facebook中的特定标签和Url按钮
下一篇: Nuget恢复依赖项目