Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Code Analysis output MSBuild

I am building projects using a build definition. When this executes, Code Analysis is also performed. Code Analysis outputs various files including:

ConsoleApplication2.exe.CodeAnalysisLog.xml
ConsoleApplication2.exe.lastcodeanalysissucceeded

Is there any way to disable this output from happing in my build definition, say through parameters or something similar?

like image 479
Matthijs Avatar asked Sep 30 '22 17:09

Matthijs


People also ask

How do I turn off Code Analysis?

To open this page, right-click the project node in Solution Explorer and select Properties. Select the Code Analysis tab. To disable source analysis at build time, uncheck the Run on build option. To disable live source analysis, uncheck the Run on live analysis option.

Which number is used to suppress the warning in a code?

Use a #pragma warning (C#) or Disable (Visual Basic) directive to suppress the warning for only a specific line of code.


1 Answers

Generation of the success marker file can be disabled using the CodeAnalysisGenerateSuccessFile option. e.g.:

<CodeAnalysisGenerateSuccessFile>false</CodeAnalysisGenerateSuccessFile>

There's no option for preventing generation of the log file, but you can move it to some other location via the CodeAnalysisLogFile option. For example, to place it in your project root folder, you could use the following:

<CodeAnalysisLogFile>CodeAnalysisLog.xml</CodeAnalysisLogFile>
like image 182
Nicole Calinoiu Avatar answered Oct 03 '22 22:10

Nicole Calinoiu