小编Dar*_*apo的帖子

.NET Core 3.1 的 Azure DevOps 代码覆盖率

我正在为 ASP.NET Core 3.1 应用程序设置 Azure DevOps 管道,并且我有以下 YAML 定义测试段)用于构建、测试和代码覆盖。

      - task: DotNetCoreCLI@2
        displayName: "dotnet global test tool install"
        inputs:
          command: 'custom'
          custom: 'tool'
          arguments: 'install --global dotnet-reportgenerator-globaltool'

      - task: DotNetCoreCLI@2
        displayName: "dotnet test"
        inputs:
          command: 'test'
          projects: '**/*[Tt]ests'
          arguments: '--no-build --configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(System.DefaultWorkingDirectory)/TestResults/Coverage'
          testRunTitle: 'Unit Test'
          workingDirectory: '$(System.DefaultWorkingDirectory)'
      - script: reportgenerator -reports:$(System.DefaultWorkingDirectory)/**/cobertura/coverage.xml -targetdir:$(System.DefaultWorkingDirectory)/CodeCoverage -reporttypes:HtmlInLine_AzurePipelines
        displayName: "create code coverage report"


      - task: PublishCodeCoverageResults@1
        displayName: "publish test coverage result"
        inputs:
          codeCoverageTool: 'Cobertura'
          summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/cobertura/coverage.xml'
Run Code Online (Sandbox Code Playgroud)

在 Azure DevOps 中运行时,出现以下错误 来自 Azure DevOps 的错误消息

我可能做错了什么?项目来源: …

yaml devops azure-devops asp.net-core azure-devops-yaml

6
推荐指数
1
解决办法
2341
查看次数

我的 msbuild 参数可能做错了什么?

我有一个 msbuild 论点

/t:Project.HQ.Web /p:DeployOnBuild=true /p:WebPublishMethod=Package 
/p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true 
/p:PackageLocation="$(build.artifactstagingdirectory)\\"
Run Code Online (Sandbox Code Playgroud)

在我的解决方案构建的 Azure DevOps 构建管道中。

我收到一个错误提示

代理作业 1:“Code\AnotherMutliProjSolution.sln(0,0):错误 MSB4014:由于内部故障,构建意外停止。System.ArgumentException:名称“Project.HQ.Web”包含无效字符“.”。在 Microsoft.Build.Shared.ErrorUtilities.ThrowArgument(Exception innerException, String resourceName, Object[] args) 在 Microsoft.Build.Construction.ProjectTargetElement.set_Name(String value) 在 Microsoft.Build.Construction.ProjectTargetElement.CreateDisconnected(String name, ProjectRootElement containsProject) at Microsoft.Build.Execution.ProjectTargetInstance.ToProjectTargetElement(ProjectRootElement rootElement) at Microsoft.Build.Execution.ProjectInstance.ToProjectRootElement() at Microsoft.Build.Construction.SolutionProjectGenerator。CreateSolutionProject(String wrapperProjectToolsVersion, Boolean explicitToolsVersionSpecified) at Microsoft.Build.Construction.SolutionProjectGenerator.Generate() at Microsoft.Build.Execution.ProjectInstance.GenerateSolutionWrapper(String projectFile, IDictionary)2 globalProperties, String toolsVersion, ILoggingService loggingService, BuildEventContext projectBuildEventContext, IReadOnlyCollection1 targetNames, ISdkResolverService sdkResolverService, Int32 submitId) 在 Microsoft.Build.Execution.ProjectInstance.LoadSolutionForBuild(String projectFile, PropertyDictionary 1 globalPropertiesInstances, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext projectBuildEventContext, Boolean isExplicitlyLoaded, IReadOnlyCollection1 …

msbuild

4
推荐指数
2
解决办法
1750
查看次数