這個問題是關於Visual Studio團隊業務的不斷整合功能,特別是在自動構建。.NET核心的NuGet還原失敗,私人的NuGet飼料(VSTS CI構建)
我已經成立了一個生成定義建立我的.NET的核心MVC應用程序。
它是使用.NET的核心v1和編制針對.NET框架4.5.2。
我在這裏跟着指示:
https://www.visualstudio.com/en-us/docs/build/apps/aspnet/ci/build-aspnet-core
我有一個私人的NuGet飼料中VSTS 這裏設置是將程序包料源的命令:
Sources Add -Name "CiiDLFeed" -UserName "<username>" -Password "<password>" -ConfigFile $(Build.SourcesDirectory)/Nuget.config -Source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json
我收到的錯誤:
error: Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json . error: Password decryption is not supported on .NET Core for this platform. The following feed uses an encrypted password: 'CiiDLFeed'. You can use a clear text password as a workaround.
針對這個問題,我補充說:「-StorePasswordInClearText」參數來的NuGet源添加命令:
Sources Add -Name "CiiDLFeed" -UserName "<username>" -Password "<password>" -ConfigFile $(Build.SourcesDirectory)/Nuget.config -Source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json -StorePasswordInClearText
現在,我得到一個401錯誤:
error: Unable to load the service index for source https://mycompany.pkgs.visualstudio.com/_packaging/DLFeed/nuget/v3/index.json . error: Response status code does not indicate success: 401 (Unauthorized).
我使用的是完全相同的憑據在一個單獨的構建定義工作正常,訪問相同的Nuget飼料(一個.NET Web窗體應用程序),所以它不應該給我一個401.
我也試圖簡單地引用庫DLL而不是NuGet打包在一個私人飼料,但似乎是沒有牛逼可能與.NET的核心:
.NET core projects only support referencing .NET framework assemblies in this release. To reference other assemblies, they need to be included in a NuGet package and reference that package.
嘗試使用V2爲feed地址。我發現v3並不總是可靠的 – trailmax
@trailmax我仍然遇到'v2'的401錯誤。感謝您的建議 –
您是否使用實際密碼或個人訪問令牌作爲密碼? – trailmax