部署到IIS时出现错误:
2020-04-06T10:51:49.9302914Z ##[error]Error: No package found with specified pattern.<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
我有:
$(System.DefaultWorkingDirectory)\**\*.zip
作为IIS Web App部署任务中的包文件夹,在第一次出现错误后,我通过选择文件夹位置更改了文件夹:
$(System.DefaultWorkingDirectory)/_MyProject-ASP.NET-CI
但是没有任何帮助。误差保持不变。
这是我的亚姆尔:
steps:
- task: IISWebAppDeploymentOnMachineGroup@0
displayName: 'IIS Web App Deploy'
inputs:
WebSiteName: '$(Parameters.WebsiteName)'
VirtualApplication: dev.myproject.com
Package: '$(System.DefaultWorkingDirectory)/_MyProject-ASP.NET-CI'
ExcludeFilesFromAppDataFlag: true
TakeAppOfflineFlag: True
XmlTransformation: true
XmlVariableSubstitution: True
以及以下用于发布工件的任务:
steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
我的构建中还有一个复制文件任务:
steps:
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
在发布工件任务之前。
我曾寻找过类似的问题,但只找到这样的解决方案:Azure DevOps管道发布错误:未找到具有指定模式:D的包:\a\r1\a\**\*。zip这是不相关的,因为我的YAML看起来像他们的建议,我已经提到复制文件的任务。
此阶段的完整日志:
2020-04-06T10:51:48.3476113Z ##[section]Starting: IIS Web App Deploy
2020-04-06T10:51:48.3785215Z ==============================================================================
2020-04-06T10:51:48.3786130Z Task : IIS web app deploy
2020-04-06T10:51:48.3786911Z Description : Deploy a website or web application using Web Deploy
2020-04-06T10:51:48.3787618Z Version : 0.156.9
2020-04-06T10:51:48.3788205Z Author : Microsoft Corporation
2020-04-06T10:51:48.3789263Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/iis-web-app-deployment-on-machine-group
2020-04-06T10:51:48.3790410Z ==============================================================================
2020-04-06T10:51:49.9302914Z ##[error]Error: No package found with specified pattern.<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
2020-04-06T10:51:49.9420801Z ##[section]Finishing: IIS Web App Deploy
我已经想不出这是什么了!
我是新发布的,所以我完全不确定还会缺少什么,或者我是否设置正确。
编辑
这是完整的YAML建筑:
pool:
name: Azure Pipelines
demands:
- msbuild
- visualstudio
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.4.1'
inputs:
versionSpec: 4.4.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
displayName: 'Use Yarn 1.22.1'
inputs:
versionSpec: 1.22.1
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@3
displayName: 'Yarn install'
inputs:
projectDirectory: Web
arguments: install
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@3
displayName: 'Yarn build'
inputs:
projectDirectory: Web
arguments: build
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(Parameters.solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: VSTest@2
displayName: 'Test Assemblies'
inputs:
testAssemblyVer2: |
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
enabled: false
- task: PublishSymbols@2
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
PublishSymbols: false
continueOnError: true
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
编辑2
VSBuild任务的日志:
2020-04-07T15:37:05.6665411Z ##[section]Starting: Build solution
2020-04-07T15:37:05.7033615Z ==============================================================================
2020-04-07T15:37:05.7034084Z Task : Visual Studio build
2020-04-07T15:37:05.7034450Z Description : Build with MSBuild and set the Visual Studio version property
2020-04-07T15:37:05.7034755Z Version : 1.166.0
2020-04-07T15:37:05.7034990Z Author : Microsoft Corporation
2020-04-07T15:37:05.7035347Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2020-04-07T15:37:05.7036406Z ==============================================================================
2020-04-07T15:37:13.7071155Z ##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -latest -format json
2020-04-07T15:37:13.7989257Z ##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
2020-04-07T15:37:13.8796977Z ##[command]"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2020-04-07T15:37:14.2358042Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "D:\a\1\s\myproject.com.sln" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=0ce4c4e1-c2fb-42a2-b03b-860f664e3238|SolutionDir=D:\a\1\s"*ForwardingLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.166.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="D:\a\1\a\\" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="15.0" /p:_MSDeployUserAgent="VSTS_ec7516ed-027d-4f0f-95e9-525fa5443e34_build_6_0"
2020-04-07T15:37:14.3407720Z Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
2020-04-07T15:37:14.3741342Z Build started 4/7/2020 3:37:14 PM.
2020-04-07T15:37:14.5565930Z ##[warning]D:\a\1\s\myproject.com.sln.metaproj(0,0): Warning MSB4126: The specified solution configuration "release|any cpu" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
2020-04-07T15:37:14.5685931Z Project "D:\a\1\s\myproject.com.sln" on node 1 (default targets).
2020-04-07T15:37:14.5693512Z D:\a\1\s\myproject.com.sln.metaproj : warning MSB4126: The specified solution configuration "release|any cpu" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:\a\1\s\myproject.com.sln]
2020-04-07T15:37:14.5773938Z Done Building Project "D:\a\1\s\myproject.com.sln" (default targets).
2020-04-07T15:37:14.5806168Z
2020-04-07T15:37:14.5806758Z Build succeeded.
2020-04-07T15:37:14.5931062Z
2020-04-07T15:37:14.5943625Z "D:\a\1\s\myproject.com.sln" (default target) (1) ->
2020-04-07T15:37:14.5945416Z (ValidateSolutionConfiguration target) ->
2020-04-07T15:37:14.5948111Z D:\a\1\s\myproject.com.sln.metaproj : warning MSB4126: The specified solution configuration "release|any cpu" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:\a\1\s\myproject.com.sln]
2020-04-07T15:37:14.5952737Z
2020-04-07T15:37:14.5952959Z 1 Warning(s)
2020-04-07T15:37:14.5953123Z 0 Error(s)
2020-04-07T15:37:14.5954912Z
2020-04-07T15:37:14.5955667Z Time Elapsed 00:00:00.20
2020-04-07T15:37:14.6534792Z ##[section]Finishing: Build solution
我简化了一点你的情况,我在build.伪像目录中得到了包
这是我的 YAML 文件
trigger:
- master
pool:
vmImage: 'windows-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 5.5.1'
inputs:
versionSpec: 5.5.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: 'stackoverflow/01/TestApp/TestApp.sln'
- task: VSBuild@1
inputs:
solution: 'stackoverflow/01/**/*.sln'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
restoreNugetPackages: true
- script: |
echo '$(build.artifactstagingdirectory)'
ls '$(build.artifactstagingdirectory)'
displayName: 'Run a multi-line script'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: 'SO-01'
condition: succeededOrFailed()
这是我在VSBuil任务日志中看到的
2020-04-07T09:33:49.9422539Z Successfully executed Web deployment task.
2020-04-07T09:33:49.9523439Z Package "WebApp.zip" is successfully created as single file at the following location:
2020-04-07T09:33:49.9526188Z file:///d:/a/1/a
你能尝试像上面这样非常简单的构建管道吗?请删除所有纱线和其他不需要的任务(包装不需要)。如果你认为这很有价值,这里有我的解决方案的链接。你能发布你的VSBuild任务的日志吗?
我已经想不出这是什么了!
似乎您正在使用Microsoft托管代理来运行构建和发布管道。注意:每次运行管道(作业/阶段)时,都会得到一个新的虚拟机。
因此,Azure DevOps 实际上提供了不同的 VM 来运行你的生成 yaml 和发布 yaml,生成 yaml 和发布 yaml 中的项目标记目录
不是同一个位置(它们甚至不在同一台计算机中)。此外,$(构建项目记录目录)
是生成变量而不是发布变量。我相信以上几点是 IIS Web 应用部署任务
抱怨缺少项目包的原因。
对此问题的建议:
生成项目可用于在生成和发布管道之间共享文件。正确的使用方法是:1. 在生成管道中使用“发布生成项目”或“发布管道项目”来发布项目。2. 然后使用发布管道中的下载生成项目或下载管道项目任务从生成管道下载已发布的项目。
需要一个额外的任务才能将项目从生成管道下载到运行发布管道的 VM。之后,部署任务可以访问发布管道中缺少的项目。
对于您的场景:您的构建yaml和发布yaml可能不在同一个多阶段管道中,因此现在更推荐您使用管道工件。
如果生成和发布位于同一 yaml 管道中,请选择当前运行,如果要使用来自其他生成管道的源代码,请选择特定运行(生成标记不是必需的选项)。执行后,此任务将从发布代理的生成中下载并提取项目。
当我试图构建我的android xamarin项目时,我得到了以下错误。我以前从来没有遇到过这个,我也不知道如何修复它。有人有什么想法吗?是否有添加依赖项的方法?我在这里想得对吗? ...Android/obj/debug/Android/src/MD548954D6403A7D9A6FE546C5860C66901/BenefitDetailFragment.java(50,50):错误:错误:
在运行Maven+Hibernate+Spring+CXF应用程序时,我遇到了“Artifact Missing:org.hibernate:hibernate-entitymanager:jar:5.0.6:final”错误。我已经将hibernate-entitymanager依赖项添加到pom.xml文件中: 但是在控制台上出现的结果如下: 屏幕上出现以下错误: 如何解决此错误消息?
但是我想使用com.oracle,Windows上的jdk目录是JDK1.8。 那么有没有办法让pom“想要”我机器上实际拥有的工具版本呢?
丢失的工件com.oracle: ojdbc6: jar:11.1.0.7.0 我正在使用Spring工具套件IDE开发Spring maven项目,该项目类似于Eclipse IDE,我在stackoverflow上找到了解决这个问题的方法,但它不适合我。我尝试了两个链接: > 缺少工件com。oracle:ojdbc6:jar:11.2.0.3, Oracle JDBC ojdbc6 Jar作
问题内容: 在Symfony2应用的路由配置中,我可以引用这样的文件: 有什么方法可以访问控制器或其他PHP代码中与包相关的文件?特别是,我尝试使用Symfony \ Component \ Yaml \ Parser对象来解析文件,并且我不想绝对引用该文件。本质上,我想这样做: 我已经签出了Symfony \ Component \ Finder \ Finder类,但我认为这不是我想要的。有任
我有一个项目A,它依赖于我的Eclipse工作区中的项目B和C。 有时我希望A运行时使用来自存储库的工件B和C,而不是工作区中的版本。因此,我选择A,然后选择'Maven->Disable Workspace Resolution',这样A将使用存储库中的版本。 附加信息:这些项目的确切版本在存储库中。事实上,如果我关闭工作区中的项目B和C,项目A会很高兴地使用B和C的存储库版本。