[英]Azure DevOps build pipeline does not include all NuGet package content files
I'm busy creating a Azure Devops build pipeline for a ASP.NET MVC application, but I'm stuck on restoring some NuGet packages.我正忙于为 ASP.NET MVC 应用程序创建 Azure Devops 构建管道,但我一直在恢复一些 NuGet 包。
I decided to add all folders to the .gitignore file that are added by NuGet package installs.我决定将所有文件夹添加到 NuGet 包安装添加的 .gitignore 文件中。 Because pipelines will reproduce this files when doing a NuGet restore.因为管道将在执行 NuGet 还原时重现此文件。
Unfortunately , for one of my installed NuGet-packages this doesn't work: the expected files were not added to my artifact.不幸的是,对于我安装的 NuGet 包之一,这不起作用:预期的文件没有添加到我的工件中。
When I install this package manually in Visual Studio, NuGet will add an assembly and some files inside the App_Plugins/uSync folder, but the NuGet restore step in Pipelines does not: it only added the assembly to the final artifact.当我在 Visual Studio 中手动安装此包时,NuGet 将在 App_Plugins/uSync 文件夹中添加一个程序集和一些文件,但 Pipelines 中的 NuGet 还原步骤不会:它仅将程序集添加到最终工件中。 The App_Plugins files are missing. App_Plugins 文件丢失。
Below my YAML representation of the build pipeline:在构建管道的 YAML 表示下方:
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'artifact'
publishLocation: 'Container'
Any help much appreciated!非常感谢任何帮助!
Just curious, what NuGet version is used in your build pipeline.As per doc , This version of the NuGet task uses NuGet 4.1.0 by default.只是好奇,您的构建管道中使用的是哪个 NuGet 版本。根据doc ,该版本的 NuGet 任务默认使用 NuGet 4.1.0。 To select a different version of NuGet, use the Tool Installer .要选择不同版本的 NuGet,请使用工具安装程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.