我正在尝试为.net Web应用程序建立一个Azure DevOps构建管道,该管道运行我的单元测试,构建该应用程序,然后在解决方案上运行Resharper代码分析,如果代码分析没有重大问题,它将发布工件。当我手动运行此管道时,出现以下错误:
## [错误]在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'
答案 0 :(得分:0)
您使用Microsoft hosted agent windows-latest
,这是一台崭新的机器,该版本未在您的PC上运行,因此该解决方案不存在。
您应在代理计算机中指定路径,例如:
$(Build.SourcesDirecotry)\DevOpsCA2\BMICalculator.sln