ASP.NET Core 1.0中的Nuget配置 [英] Nuget Configuration in ASP.NET Core 1.0

查看:168
本文介绍了ASP.NET Core 1.0中的Nuget配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们现有的解决方案中,我们有一个NuGet.Config文件,其内容如下:

In our existing solution we have a NuGet.Config file with the following content:

<?xml version="1.0" encoding="utf-8"?> 
<configuration>   
    <solution>
        <add key="disableSourceControlIntegration" value="true" />           
    </solution>
    <config>
        <add key="repositorypath" value="NuGetPackages" />
    </config> 
</configuration>

通过此配置,我们告诉NuGet将所有软件包存储在"NuGetPackages"文件夹中.这对于我们所有现有项目(WebApi,库等)都可以正常工作,但是如果我添加一个新的ASP.NET Core项目,则程序包将存储在C:\Users\<username>\.dnx\packages文件夹中.

With this config we tell NuGet to store all packages in the "NuGetPackages" folder. This works fine for all our existing Projects (WebApi, Libraries, ...), but if I add a new ASP.NET Core project, the packages are stored in the C:\Users\<username>\.dnx\packages folder.

是否可以在解决方案级别更改软件包文件夹?

Is there a way to change the package folder on solution level?

谢谢!

推荐答案

是的,您可以使用global.json来实现:

Yeah, you can use the global.json for that:

{
  "packages": "NuGetPackages",
  "projects": [ "src", "test" ],
  "sdk": {
    "version": "1.0.0-rc1-update1"
  }
}

请参阅: https://github.com/aspnet/Home/wiki/Package-位置

这篇关于ASP.NET Core 1.0中的Nuget配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆