Show Code Analysis warnings in VSTS

前端 未结 2 1164
礼貌的吻别
礼貌的吻别 2021-01-26 20:33

I\'ve setup Static Code Analysis on my Visual Studio Team Services builds. I\'m using the \"MSBuild\" build step for my solution and in the build logs it shows 999+ lines that s

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-26 21:12

    Yes, just part of warnings in build display in the Issues section of build summary.

    The workaround is that you can upload the code analysis result file (xml) through Logging Commands (##vso[task.uploadsummary]local file path)and the content shall be added to build/release summary (Below Work items linked to associated changes section)

    1. Add Powershell task
    2. Call logging command to upload code analysis result

    For example:

    param(
    [string]$p
    )
    Write-Host "##vso[task.uploadsummary]$p"
    

    Arguments:

    -p $(Build.SourcesDirectory)\WebAppAzureProfile\bin\WebAppAzureProfile.dll.CodeAnalysisLog.xml

提交回复
热议问题