In our product, there are around 400 projects, so in VS 2012, if I want to make a build then it generates code analysis for all 400 projects and I can't manually disable code analysis for each & every project. So I am looking for a mechanism which disables code analysis for entire solution (all projects) rather then applying those settings to individual projects.
相关问题
- Resharper 7 on VS2012 ignores assembly redirect in
- Error installing MVVMCross from nuget into a PCL
- Why can't I bind to winproc?
- Getting Sum of an SQL table column until the sum r
- OPENCV linking Error - Win32 & VS2012
相关文章
- Visual Studio Hangs on Loading UI Library
- “Csc.exe” exited with code -1073741819
- Add Fakes Assembly option missing
- Visual Studio wants to build with wrong platform t
- Visual Studio 2012 debug tests keyboard shortcut
- Visual Studio: How to properly build and specify t
- What are skipped tests in visual studio?
- Visual Studio 2012 designer error
You could write a little console application that reads all the project files out of a solution file and then toggle the Xml Node of each project.
Function to get the project files out of the solution:
And the function to toggle the RunCodeAnalysis Node(s):
You can use a little trick to disable the static code analysis for a whole Visual Studio instance as described here. In short:
Developer Command Prompt for VS2012
set DevDivCodeAnalysisRunType=Disabled
devenv
to start Visual StudioSame solution works for Visual Studio 2015 via
Developer Command Prompt for VS2015
.You can use the Package Manager Console window of Nuget to do that.
Create a new text file in the directory "C:\Users{your user}\Documents\WindowsPowerShell" named "NuGet_profile.ps1" and add the following code:
Restart Visual Studio. Click the menu "View" | "Other Windows" | "Package Manager Console". Now you can execute the following commands:
Not sure there is an easy to do this with VS2012. CodeAnalysis is defined at project level and depends on your build configuration. For example, there is no code analysis in Release.
First, try to create a configuration based on Release.
Another solution (but very bad) may be to run a batch to modify all your project files.
Here is a sample project file (check the element named RunCodeAnalysis) :
To disable code analysis for particular project :-