Show Code Analysis warnings in VSTS

前端 未结 2 1126
礼貌的吻别
礼貌的吻别 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 20:51

    After some months of working with VSTS, my experience is as follows;

    • Code Analysis warnings will show up on the build summary
    • VSTS will only show the first 11 warnings
    • Thus, if the Code Analysis warnings are printed after 11 build warnings, they won't show up.

    We've started using Build Quality Checks to fail the build when there are more warnings compared to the baseline.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题