【问题标题】:azure build pipeline error using resharper task使用 resharper 任务的天蓝色构建管道错误
【发布时间】:2019-11-01 04:24:22
【问题描述】:

我正在尝试为运行我的单元测试、构建应用程序然后对解决方案运行 Resharper 代码分析的 .net Web 应用程序创建 Azure DevOps 构建管道,如果代码分析没有重大问题,它将发布一个工件。当我手动运行此管道时,出现以下错误:

##[错误]在 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'

【问题讨论】:

    标签: azure azure-devops resharper azure-pipelines


    【解决方案1】:

    你使用Microsoft hosted agentwindows-latest,它是新机器,构建不是在你的电脑上运行的,所以这个路径中不存在解决方案。

    您应该在代理机器中指定路径,例如:

    $(Build.SourcesDirecotry)\DevOpsCA2\BMICalculator.sln
    

    【讨论】:

    • 感谢您的回复。我尝试了 solutionOrProjectPath: '$(Build.SourcesDirecotry)\DevOpsCA2\BMICalculator.sln' 虽然我仍然收到此错误:##[error]No solution or project found at d:\a\1\s\$(Build. SourcesDirecotry)\DevOpsCA2\BMICalculator.sln
    • solutionOrProjectPath: 'BMICalculator/BMICalculator.csproj' 工作正常。再次感谢谢基的帮助
    猜你喜欢
    • 1970-01-01
    • 2020-10-20
    • 2020-02-06
    • 2021-11-23
    • 2019-03-18
    • 1970-01-01
    • 2020-07-07
    • 1970-01-01
    • 2020-09-01
    相关资源
    最近更新 更多