全新 windows 安装时的 Nuget 配置和 dnu 恢复

Nuget config and dnu restore on fresh windows install

启动新服务器并 运行 后,我尝试让 dnx 项目运行。我 运行 dnu restore 一个项目,并得到这个错误。

Errors in C:\apps\ElasticIndexer\app\project.json Unable to locate Dependency TestApplication >= 1.0.1

Feeds used: https://api.nuget.org/v3-flatcontainer/

我的问题是我无法更改使用的 nuget 提要,因为我们将 nuget 包托管在不同的服务器上。我在 %appdata% 中搜索,没有 nuget 的文件夹。然后我决定在整个服务器上搜索 nuget.config,但没有 nuget.config 文件。

我不想在此服务器上安装 Visual Studio,但我的 %appdata% 文件夹中没有 nuget 文件夹是有原因的吗? dnu 怎么知道默认搜索 api.nuget.org 呢?安装最新的 dnvm 时是否也应该创建 nuget 位置,还是我需要手动创建文件夹和配置文件?

如果您的服务器上没有 nuget.config 文件,您可以尝试 运行 nuget 安装。如果这不起作用,请尝试通过命令行更新源:

NuGet.exe Sources Add -Name <feedName> -Source <pathToPackageSource>