哪些 NuGet 源用于还原? [英] What NuGet sources are used for restore?

查看:24
本文介绍了哪些 NuGet 源用于还原?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的 mac 上做一个简单的 dotnet restore.我正在使用(目前)最新的 dotnet CLI 2.2 版.

因为您可以在项目文件夹中同时拥有 NuGet.Config 文件和机器范围的配置,所以说:

  • ~/projects/helloworld/.NuGet/NuGet.Config

  • ~/.nuget/NuGet/NuGet.Config

有什么方法可以询问 dotnet restore 之类的问题,例如嘿,如果如果要运行您,您实际上会使用哪种 NuGet 源组合?"

您可能已经猜到我的问题是我不确定是否使用了我定义的所有来源.

(实际上我的问题是运行 dotnet restore --interactive 不会提示我,这是我所期望的,所以我认为 NuGet 甚至没有尝试从我定义的源中获取包)

希望大家帮帮我.

解决方案

使用 dotnet restore -v:n 使 dotnet restore 以verbosity"级别显示信息普通的".这将向您显示很多信息.最后,您将获得如下信息:

 使用的 NuGet 配置文件:/home/omajid/.nuget/NuGet/NuGet.Config使用的饲料:https://api.nuget.org/v3/index.json

这会显示使用了哪些 nuget 配置文件和 nuget 提要.

(不幸的是,似乎没有选项可以说只给我看,但不要进行还原".)

I'm doing a simple dotnet restoreon my mac. I'm using the (for now) latest dotnet CLI version 2.2.

Since you can have both a NuGet.Config file in your project folder and a machine-wide config, say:

  • ~/projects/helloworld/.NuGet/NuGet.Config

  • ~/.nuget/NuGet/NuGet.Config

Is there any way to ask dotnet restore like "hey, if if were to run you, what combination of NuGet sources would you actually use?"

As you might have guessed my problem is that i'm not really sure that all my defined sources are used.

(actually my problem is that running dotnet restore --interactivedoes not prompt me, which I would expect, so I assume NuGet is not even trying to fetch packages from my defined source)

Hope you guys can help me out.

解决方案

Use dotnet restore -v:n to make dotnet restore display information with "verbosity" level of "normal". This will show you a lot of information. Towards the end, you will get information like this:

     NuGet Config files used:
         /home/omajid/.nuget/NuGet/NuGet.Config

     Feeds used:
         https://api.nuget.org/v3/index.json

That shows which nuget config files and nuget feeds were used.

(Unfortunately, there doesn't seem to be a option to say "just show me, but don't do a restore".)

这篇关于哪些 NuGet 源用于还原?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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