Is it possible to change the location of packages for NuGet?

前端 未结 15 1980
误落风尘
误落风尘 2020-11-22 17:11

I have the following convention for most of my projects:

/src
    /Solution.sln
    /SolutionFolder
        /Project1
        /Project2
        /etc..
/lib
          


        
15条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 17:43

    For .NET Core projects and Visual Studio 2017 I was able to restore all packages to relative path by providing this configuration:

    
      
        
      
      ... 
    
    

    Based on my experience the lib folder was created on the same level where Nuget.config was found, no matter where sln file was. I tested and the behavior is same for command line dotnet restore, and Visual Studio 2017 rebuild

提交回复
热议问题