简体   繁体   中英

visual studio enforce build error using code analysis

I'm new to C# and the project as well. My team members are making a lot of spelling mistakes in strings. My manager want that the build should fail if there are spelling errors. While searching I found out Visual Studio Code Analysis tool and Spell Checker Plugins .

I have configured Code Analysis tool so that it shows analysis error if there are spelling mistakes. Is there any way to a enforce it as a build failure in such situation? And is it a good approach? Is there any better approach? I'm using VS2012.

EDIT

I have configured Code Analysis to run on every build. Now it's showing an error on running project after saving the code but if I run the code again (without saving), it runs successfully. But I want it show show error on every run until Code Analysis errors are resolved.

I don't think enforcing build error using code analysis is a good approach, it is really disturbing for the developer while writing the code and the developer can just turn off or uninstall the plugin in their environment.

What you might need to have is setting up a build server that runs the code analysis as part of it. It could be cruise control .net or team city or sonarqube .

You can run other things on that server, like unit test, auto deployment, complexity report, commenting, etc.

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