问题 I have been trying to make my solution fail to build on Visual Studio Team Services when there are warnings. I have enabled the option in the project in VS2017 to treat warnings as errors, so that it won't build. Treat warnings as errors set to All Also, there is a MsBuild argument for the same purpose set to true on VSTS. Treat warnings as errors set to true This works, as when there is a warning it is treated as error (Eg. an unused int is a warning and becomes an error, failing the build).