簡體   English   中英

VisualStudio Online並打包Nuget包

[英]VisualStudio Online and pack Nuget packages

當我有一些類庫時,我正在Visual Studio OnLine創建一個存儲庫。 我想創建(打包)並在我的私有存儲庫中為每個推送一個Nuget包。

在項目中,對Microsoft.ApplicationInsights有依賴性。 如果我在計算機上創建一個程序包,它就可以正常工作。 如果我嘗試在Visual Studio Online上執行相同的操作,則會出現錯誤:

nuget命令失敗,並顯示退出代碼(1)和錯誤(NuGet.CommandLine.CommandLineException:無法找到'Microsoft.ApplicationInsights.2.6.4.nupkg'。請確保已構建項目。

這是完整的錯誤:

NuGet版本:4.1.0.2450嘗試從“ Vu.Common.Logging.AppInsightsEvent.csproj”構建軟件包。 MSBuild自動檢測:使用來自'C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ Enterprise \\ MSBuild \\ 15.0 \\ bin'的msbuild版本'15 .6.85.37198'。 使用選項-MSBuildVersion強制nuget使用特定版本的MSBuild。 從'D:\\ a \\ 1 \\ s \\ Vu.Common \\ Vu.Common.Logging.AppInsightsEvent \\ bin \\ Release'打包文件。 使用“ Vu.Common.Logging.AppInsightsEvent.nuspec”獲取元數據。 將文件'D:\\ a \\ 1 \\ s \\ Vu.Common \\ Vu.Common.Logging.AppInsightsEvent \\ bin \\ Release \\ Vu.Common.Logging.AppInsightsEvent.dll'打包為'lib \\ net462 \\ Vu.Common。 Logging.AppInsightsEvent.dll'找到了packages.config。 使用列為依賴項的程序包NuGet.CommandLine.CommandLineException:無法找到“ Microsoft.ApplicationInsights.2.6.4.nupkg”。 確保已構建項目。 在NuGet.CommandLine.ProjectFactory.CreateBuilder處的NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder Builder)處的NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2packagesAndDependencies)處(String basePath,NuGetVersion版本,字符串后綴,布爾值buildIfNeeded,PackageBuilder構建器)在NuGet.Commands.PackCommandRunner.BuildFromProjectFile(字符串路徑)
在NuGet.CommandLine.PackCommand.ExecuteCommand()在NuGet.CommandLine.Command.ExecuteCommandAsync()在NuGet.CommandLine.Command.Execute()在NuGet.CommandLine.Program.MainCore(String workingDirectory,String [] args)

我的配置很簡單。 我添加了兩個Nuget ,第一個是打包我的nuget,第二個是將它推送到存儲庫中。

我嘗試了不同的配置,還手動創建了nuspec文件,但沒有結果。

有任何想法嗎? 打包和部署金塊軟件包的正確方法是什么?

Visual Studio在線

更新資料

在構建期間,我看到的錯誤是這樣的:

VSTS構建錯誤

然后,我嘗試在本地文件夾中創建相同的程序包。 我只刪除了OutputDirectoryNonInteractive和初始路徑。 我可以毫無問題地創建軟件包。

本地

根據錯誤消息,您的nuget軟件包似乎無法從url下載引用的nuget軟件包。

您可以嘗試直接使用Package:NuGet擴展名,然后選擇Pack NuGet packages並嘗試agian,而不是使用customize nuget命令。

在此處輸入圖片說明

可以通過添加system.debug=true啟用“詳細調試模式”以獲取更多詳細日志,以進行故障排除並縮小問題范圍。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM