简体   繁体   English

Azure DevOps 构建管道不包括所有 NuGet 包内容文件

[英]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.

相关问题 从构建或发布管道在 azure devops 中发布 nuget 包 - Publish nuget package in azure devops from build or release pipeline Azure DevOps构建管道:从MsBuild.exe解决方案创建NuGet程序包 - Azure DevOps Build Pipeline: Create NuGet Package from MsBuild.exe Solution Azure DevOps:无法从 Azure Pipeline 中的提要加载 nuget 包 - Azure DevOps: Can not load nuget package from feed in Azure Pipeline 在离线服务器上构建 Azure Devops Pipeline - NuGet 包? - Azure Devops Pipeline build on OFFLINE server - NuGet packages? 自托管 MacOS 代理上的 DevOps 管道在 NuGet package 恢复但适用于 Azure 管道上失败 - DevOps pipeline on self-hosted MacOS agent fails on NuGet package restore but works on Azure Pipeline 在单独的 Azure DevOps 存储库和构建管道中触发 Package 版本更新 - Triggering A Package Version Update In Separate Azure DevOps Repo and Build Pipeline 如何从另一个 package 源安装 nuget package - How to install a nuget package from another package source in azure devops pipeline? 是否可以在 Azure DevOps 的构建管道期间下载文件/数据? - Is it possible to download files/data during the build pipeline on Azure DevOps? Azure 适用于所有存储库的 DevOps 通用分支策略构建管道 - Azure DevOps Common Branch Policy Build Pipeline for all Repositories flutter 使用 azure devops 构建管道 - flutter build pipeline with azure devops
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM