我在Ubuntu 14.04上運行.NET Core 1.1.0,目標是在Ubuntu的Docker中託管我的Web API。我想在Ubuntu上構建我的包,但是一些NuGet引用託管在內部NuGet存儲庫(Artifactory)上。之後我添加了包源此工程在Windows VS2015很好,但是當我運行:如何在Ubuntu 14.04上使用dotnet CLI註冊新的NuGet包源代碼?
dotnet restore
在Ubuntu上,託管在公衆的NuGet回購下載精美的包裝,但那些Artifactory的失敗:
error: Unable to resolve 'Mercury.BaseModel (>= 1.1.0)' for '.NETCoreApp,Version=v1.1'.
我發現的NuGet配置文件在\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>
,但我仍然得到同樣的錯誤。
安裝.NET Core SDK後,NuGet本身無法工作,我正在使用dotnet restore
- 我是否有類似的配置,我必須爲dotnet CLI(必須使用NuGet?)編輯或者是否有其他需要去做?
謝謝!
您也可能會發現添加的NuGet包有幫助的新DOTNET CLI支持: http://ardalis.com/how-to-add-a-nuget-package-using-dotnet-add – ssmith
這是值得的知道,雖然在這裏我問的是添加一個新的包源代碼;我可以看到自己使用dotnet add,謝謝。 – Peter
啊,好點。對不起,誤解了。 :) – ssmith