【发布时间】:2018-06-06 08:15:35
【问题描述】:
当我有一些类库时,我正在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”中的 msbuild 版本“15.6.85.37198” (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'。采用 选项 -MSBuildVersion 强制 nuget 使用特定版本的 微软构建。打包文件来自 '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.AddDependencies(字典`2 包和依赖项)在 NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder) 在 NuGet.CommandLine.ProjectFactory.CreateBuilder(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(字符串工作目录,字符串 [] 参数)
我的配置很简单。我添加了两个Nuget,第一个是打包我的nuget,第二个是推送到存储库中。
我尝试了不同的配置,还手动创建了nuspec 文件,但没有结果。
有什么想法吗?打包和部署 nugget 包的正确方法是什么?
更新
在构建过程中,我看到的错误是这样的:
然后我尝试在我的本地文件夹上创建相同的包。我只删除了OutputDirectory、NonInteractive 和初始路径。我可以毫无问题地创建包。
【问题讨论】:
-
运行pack命令前包是否恢复?
标签: c# visual-studio nuget azure-pipelines azure-artifacts