Build output difference - VS Build vs dotnet build

228 views Asked by At

I am trying to implement a pre-commit hook where I build the solution and check for any warnings. When I build the solution in VS I am getting warning but where as when I run dotnet build using powershell I get zero warnings.

Below is the CLI dotnet build --no-incremental --configuration Release and the result I get is like "Determining projects to restore and so on and at the end I can see Build succeeded with 0 Warning(s)" But if I do a normal build in VS I can see there are two warnings. The warnings are part of the custom .editorconfig file I have added.

So the PS command won't consider the .editorconfig file ?

I tried dotnet clean as well which ideally cleans and builds the solution again but there also I am getting 0 warning(s).

1

There are 1 answers

0
Arjun Menon On

I added the property AllEnabledByDefault as mentioned in the link (Link) to get the Code Analysis response in the build event.