How do you prevent Visual Studio from switching to the Code Analysis tab after each build?

不问归期 提交于 2019-12-18 13:52:53

问题


After each build, Visual Studio 2012 switches from the Solution Explorer to the Code Analysis tab, usually with the yellow "No code analysis issues were detected." (Might as well say "TA DA!").

Is there an option to turn off the tab switching (keeping it on Solution Explorer)? [because I can't find it either in Solutions or Options].

Thanks!


回答1:


VS 2012

The best answer I have found so far is to drag the Code Analysis view's tab away from the Solution explorer. I've docked mine below the Solution explorer and made it about 1 inch high - so I can still see what it is reporting on the rare occasions when I wish to check it, but without losing my Solution Explorer all the time.

It's still unnecessary but a lot less irritating.


Update - VS 2013

In VS 2013 you can now click the Settings option in the Code Analysis view, and disable the Show window when issues are detected option.




回答2:


Right Click Project --> Properties --> Code Analysis Tab --> Uncheck Enable Code Analysis on Build.

Hope that Helps.




回答3:


Just found very helpful blog post about your issue Temporarily disable the C# static code analysis for a whole VS instance.

Also I have found way to permanently disable Code Analysis for all VS 2012 instances: You need to add Windows environment variable with name "DevDivCodeAnalysisRunType" and value "Disabled" (all without quotes). There is helpful post about Windows environment variables How To Add/Edit Environment Variables in Windows 7.

Hope that helps.



来源:https://stackoverflow.com/questions/11199625/how-do-you-prevent-visual-studio-from-switching-to-the-code-analysis-tab-after-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!