问题描述
我正在Mac上执行简单的dotnet restore
.我正在使用(暂时)最新的 dotnet CLI 2.2版.
I'm doing a simple dotnet restore
on my mac. I'm using the (for now) latest dotnet CLI version 2.2.
由于您既可以在项目文件夹中找到NuGet.Config文件,又可以在计算机范围内拥有配置,所以说:
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
有没有办法问dotnet restore
,例如嘿,是否,如果要运行您,您将实际使用NuGet源的哪些组合?"
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.
(实际上,我的问题是运行dotnet restore --interactive
不会提示我,这是我期望的,所以我认为NuGet甚至没有尝试从定义的源中获取软件包)
(actually my problem is that running dotnet restore --interactive
does not prompt me, which I would expect, so I assume NuGet is not even trying to fetch packages from my defined source)
希望你们能帮助我.
推荐答案
使用dotnet restore -v:n
使dotnet restore
以详细"级别为正常"显示信息.这将向您显示很多信息.最后,您将获得如下信息:
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
显示使用了哪些nuget配置文件和nuget提要.
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源用于还原?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!