简体   繁体   中英

Returning warnings from custom msbuild in TFS

In TFS 2018, I have a build step which calls on a batch script which sets various environment variables and involves msbuild on a solution file. Currently, if a project has warnings, there's no way to view them in TFS unless you look at the log files and see what the warnings are. If you run a native Visual Studio Build task, warnings are shown to you after a build.

How can I return warnings to TFS after my msbuild command completes?

You can try to return warnings and errors from your script using logging commands .

eg:

For PowerShell script you can use below logging commands:

Write-Host "##vso[task.logissue type=warning;]Test warning"
Write-Host "##vso[task.logissue type=error;]Test error"

For Batch script:

@echo ##vso[task.logissue type=warning;]Test warning
@echo ##vso[task.logissue type=error;]Test error

Reference this thread : Is it possible to raise and display build warnings from build steps using TFS 2015?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM