小编and*_*rea的帖子

覆盖默认的 nuget.config 文件

我在 .sln 文件与 nuget.config 相同的位置添加了此配置

<packageSources>
    <add key="local repo" value="C:\myproject\nugetRepository" />
</packageSources>
Run Code Online (Sandbox Code Playgroud)

我在 appdata/roaming/NuGet 中也有默认的 nuget.config ,配置如下

<packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
Run Code Online (Sandbox Code Playgroud)

在线阅读时,我了解到根项目中的 nuget.config 应该覆盖默认配置,但是,在使用 MSBuild 构建时,它始终使用 appdata 中的配置!我如何指定使用根项目中的那个?

.net msbuild nuget nuget-package nuget-package-restore

2
推荐指数
1
解决办法
2123
查看次数