繁体   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