【发布时间】:2019-12-03 07:42:23
【问题描述】:
我在 Docker 中运行“dotnet restore” 我的 Nuget.Config 的相关部分如下所示
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="MyNuget" value="https://mynugetsource.com/nuget/v3/index.json" />
</packageSources>
</configuration>
来自我的 Dockerfile
COPY ["NuGet.Config", "myproject.Api/"]
RUN dotnet restore "myproject.Api/myproject.Api.csproj" --configfile nuget.config
其中一个包是我从 nuget.org 获得的“MassTransit”,但还原操作给了我错误
无法从以下位置下载包“MassTransit.5.5.6” 'https://mycompanysource.com/.../nuget/v3/flat2/masstransit/5.5.6/masstransit.5.5.6.nupkg'。
出于某种原因,私人来源拥有 MassTransit (5.5.5),所以我认为这使事情变得混乱。 我能否以某种方式强制 nuget 使用 MassTransit 的特定来源?(我需要 nuget.org 和私有 nuget 存储库)
【问题讨论】: