启用包还原后如何指定nuget包的位置? [英] how to specify location of nuget packages when package restore is enabled?
问题描述
我正在研究.net解决方案,并使用nuget进行程序包管理.我选择了启用Nuget软件包还原"选项,以便nuget软件包不签入源代码管理.
I am working on a .net solution and use nuget for my package management. I have selected the option to "Enable Nuget Package Restore" so that the nuget packages not checked in to source control.
在此之前,我有一个nuget.config文件,与解决方案处于同一级别,其中包含以下内容,可让我指定nuget软件包的位置.
Prior to this I had a nuget.config file at the same level as the solution where I included to following enabling me to specify the location of the nuget packages.
<settings>
<repositoryPath>..\Build\NuGetPackages\</repositoryPath>
</settings>
自从我启用nuget软件包还原以来,它不再起作用.我尝试更新.nuget生成的文件夹中的配置文件,但这也不起作用.
Since I enabled the nuget package restore, this is no longer working. I tried to update the config file within the .nuget generated folder but that does not work either.
那么我要去哪里错了,如何指定packages文件夹的位置?
So where I am going wrong and how can I specify the location of the packages folder?
推荐答案
您可以更改your-solution\.nuget\NuGet.targets
文件中的下一个属性:
You can change the next property in your-solution\.nuget\NuGet.targets
file:
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
或相同的属性,但如果使用的是Mono,则在下面的组中.
Or the same property, but in group below if you are using Mono.
这篇关于启用包还原后如何指定nuget包的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!