gpt4 book ai didi

Azure构建管道不起作用: unable to create directory D:\a\1\a\

转载 作者:行者123 更新时间:2023-12-03 07:02:36 32 4
gpt4 key购买 nike

我正在学习 Azure DevOps,但我被构建管道所困扰。该项目是一个简单的 .NET Core Web 应用程序,这是 YAML 文件

# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- main

pool:
vmImage: 'windows-latest'

variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '**/azpipe.csproj'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\'
platform: '$(buildConfiguration)'
configuration: '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

当我运行管道时,出现错误,这是日志

Publish:
azpipe -> D:\a\1\s\obj\Debug\net5.0\PubTmp\Out\
_TransformWebConfig:
No web.config found. Creating 'D:\a\1\s\obj\Debug\net5.0\PubTmp\Out\web.config'
_PrepareForMsDeployPublish:
Creating directory "D:\a\1\a\ \p:platform=Release \p:configuration=Release \p:VisualStudioVersion=17.0 \p:_MSDeployUserAgent=VSTS_ac5aa204-3429-4edf-ae3d-777f0b31c141_build_9_0\".
##[warning]C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk.Publish\targets\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(156,5): Warning MSB3191: Unable to create directory "D:\a\1\a\ \p:platform=Release \p:configuration=Release \p:VisualStudioVersion=17.0 \p:_MSDeployUserAgent=VSTS_ac5aa204-3429-4edf-ae3d-777f0b31c141_build_9_0\". The given path's format is not supported.
C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk.Publish\targets\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(156,5): warning MSB3191: Unable to create directory "D:\a\1\a\ \p:platform=Release \p:configuration=Release \p:VisualStudioVersion=17.0 \p:_MSDeployUserAgent=VSTS_ac5aa204-3429-4edf-ae3d-777f0b31c141_build_9_0\". The given path's format is not supported. [D:\a\1\s\azpipe.csproj]
The previous error was converted to a warning because the task was called with ContinueOnError=true.
Build continuing because "ContinueOnError" on the task "MakeDir" is set to "true".

到目前为止,有很多这样的行。

我尝试了几种找到的解决方案,但无法使其工作。有人可以帮助我吗?

谢谢!

最佳答案

根据警告消息“Warning MSB3191:无法创建目录”D:\a\1\a\\p:platform=Release\p:configuration=Release\p:VisualStudioVersion=17.0\p: _MSDeployUserAgent=VSTS_ac5aa204-3429-4edf-ae3d-777f0b31c141_build_9_0\"。不支持给定路径的格式。"

给定路径的格式似乎不正确。在您的 yaml 文件中,您指定了项目,但没有指定解决方案。

请指定解决方案而不是项目,引用以下格式:

- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildConfiguration)'
configuration: '$(buildConfiguration)'

关于Azure构建管道不起作用: unable to create directory D:\a\1\a\,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72087219/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com