ASP.NET Core 1.0中的Nuget配置

编程入门 行业动态 更新时间:2024-10-26 11:16:36
本文介绍了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" } }

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

更多推荐

ASP.NET Core 1.0中的Nuget配置

本文发布于:2023-11-05 07:23:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560249.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NET   ASP   Core   Nuget

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!