[英]azure build pipeline error using resharper task
I am trying to make an Azure DevOps build pipeline for a .net web app that runs my unit tests, builds the app and then runs Resharper code analysis on the solution and if there are no major issues with code analysis, it will publish an artifact. 當我手動運行此管道時,出現以下錯誤:
##[錯誤]在 C:\Users\35385\source\repos\DevOpsCA2\BMICalculator.sln 找不到解決方案或項目
我不知道為什么我會得到這個,因為這是解決方案的正確路徑。任何人都可以看到我做錯了什么嗎?
我的.yaml
管道:
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/BMIUnitTestProject/*.csproj'
arguments: '--configuration $(buildConfiguration)'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: ResharperCli@2
inputs:
solutionOrProjectPath: 'C:\Users\35385\source\repos\DevOpsCA2\BMICalculator.sln'
additionalArguments: '--properties:Configuration=$(Build.Configuration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet publish --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
inputs:
command: publish
publishWebProjects: true
projects: '**/BMICalculator/*.csproj'
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishBuildArtifacts@1
displayName: 'publish artifacts'
您使用Microsoft 托管代理windows-latest
,它是新機器,構建不在您的PC 上運行,因此此路徑中不存在解決方案。
您應該在代理機器中指定路徑,例如:
$(Build.SourcesDirecotry)\DevOpsCA2\BMICalculator.sln
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.