I hava a solution which contains two Project.
/Solution
.sln
.nuget.config
/ProjectA
.csproj
.nuspec
/ProejctB
.csproj
.nuspec
When I add a dependency ProjectA via nuget.
Project structure is become something like this:
/Solution
.sln
nuget.config
/packages
.nupkg
/lib
.dll
/ProjectA
.csproj
.nuspec
packages.config
/ProejctB
.csproj
.nuspec
Basically, Visual Studio create a packages.config file and put dependency there. And, dependency is added to /packages
folder. Also, .csproj
content changes.(A Reference added which has a relative path to dll inside /packages
folder.)
I have two question.
1- Inside nuget.config file I have put following line. So I expect nuget will use default local repository instead of creating a /packages
folder in solution. How can I prevent creation of a /packages folder in solution. Instead I would like to use "%userprofile%\.nuget\packages"
.
<add key="globalPackagesFolder" value="%userprofile%\.nuget\packages" />
2- When I add the dependency as nuget package. Still .csprj
file is changed and dll's related path is added there as a reference with relative path. Is it ok? Isn't auto generated packages.config
enough. Why also this file is updated.