I have been struggling with this for a while. I have searched and tried different things but it does not work, so I am posting this here.
I want to treat warnings as errors when building on TFS level and this option has not been working.
I have done it like suggested on other posts: I have tried: /p:TreatWarningsAsErrors=true and /p:TreatWarningsAsErrors="true"
Enabling TreatWarningsAsErrors
However, that as been unsuccessful as when building I have the following result: The warning is not treated as error on TFS build.
Warning About Unused int
The build is successful As the image below shows and there are no errors.
No errors in build
Can anyone help me with insight on this about how to do it?
Update: Obs: I do know the option to set TreatWarningAsErrors on the properties of the project when using VS2017 and that works, as warning are treated as errors there, but that does not work for TFS.
TreatWarningAsError on VS2017 project properties
Warning becomes error
I have enabled treat warnings as errors in VS2017, under project properties, for both Debug and Release.
Build on TFS