相关疑难解决方法(0)

如何在Ubuntu 14.04上使用dotnet CLI注册新的NuGet包源?

我在Ubuntu 14.04上运行.NET Core 1.1.0,目标是在Ubuntu上的Docker中托管我的Web API.我想在Ubuntu上构建我的包,但是一些NuGet引用托管在内部NuGet存储库(Artifactory)上.添加包源后,这在Windows上的VS2015中工作正常,但是当我运行时:

dotnet restore
Run Code Online (Sandbox Code Playgroud)

在Ubuntu上,公共NuGet repo下载的软件包下载很好,但Artifactory上的软件包失败:

error: Unable to resolve 'Mercury.BaseModel (>= 1.1.0)' for '.NETCoreApp,Version=v1.1'.
Run Code Online (Sandbox Code Playgroud)

我找到了一个N​​uGet配置文件\home\<user>\.nuget\NuGet\NuGet.Config并添加了Artifactory存储库,如下所示:

<?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="Artifactory-DEV" value="https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local" protocolVersion="3"/>
  </packageSources>
</configuration>
Run Code Online (Sandbox Code Playgroud)

但我仍然得到同样的错误.

安装.NET Core SDK之后NuGet本身不起作用,我正在使用dotnet restore如上所述 - 我是否必须为dotnet CLI编写类似的配置(必须使用NuGet?)或者还有其他我需要做的事情吗?

谢谢!

nuget docker ubuntu-14.04 .net-core asp.net-core

20
推荐指数
2
解决办法
2万
查看次数

标签 统计

.net-core ×1

asp.net-core ×1

docker ×1

nuget ×1

ubuntu-14.04 ×1