Would like to know if a lot of warning can increase the website build time using 'task: VSBuild@1' and 'msbuildArgs' as input
-
For sure it impacts but I would say that in a level not measurable for human perception. You may try to crate simple console app and add 10K lines which causes warning each line and check it on your own. – Krzysztof Madej Jan 08 '21 at 12:35
-
@KrzysztofMadej Is there any property for 'msbuildArgs' through which we can suppress them ? – sumit tandon Jan 08 '21 at 12:51
1 Answers
Would like to know if a lot of warning can increase the website build time using 'task: VSBuild@1' and 'msbuildArgs' as input
Agree with KrzysztofMadej. A large number of warnings will increase the compiler's compilation time. When the compiler encounters a warning, it needs to do some simple actions and warning positioning and analysis, so that it can give a meaningful warning prompt in the log.
For a scenario we often encounter, when compiling the project to reference the assembly, the correct compilation will directly find the matching assembly, but if the assembly is not found, the compiler will try to go to some msbuild/extension, framework folder to search for the required dll files. These additional operations will undoubtedly increase the time of the compiler.
Is there any property for 'msbuildArgs' through which we can suppress them?
You could use msbuildArgs /p:WarningLevel=X
supress the warning level for those C# warnings (e.g. CS0618)
:
Warning
Level Meaning
-------- -------------------------------------------
0 Turns off emission of all warning messages.
1 Displays severe warning messages
2 Displays level 1 warnings plus certain, less-severe warnings, such
as warnings about hiding class members
3 Displays level 2 warnings plus certain, less-severe warnings, such
as warnings about expressions that always evaluate to true or false
4 (the default) Displays all level 3 warnings plus informational warnings
For those MSBuild warnings, it can't be suppressed.
You could check this thread for some more details.

- 71,098
- 10
- 114
- 135