How to find the reason for a failed Build without any error or warning

I noticed that if “Build + Intellisense” is selected in the Error List, it causes the error messages to be swallowed.

Change this option to “Build Only“, and all error messages will be displayed:

Screenshot

I don’t know if this is a bug in Visual Studio or what, but it certainly revealed hidden error messages that were the key to pinpointing the failure for me.

Some, like Richard J Foster, have suggested increasing the “MSBuild project build output verbosity” setting to “Diagnostic” (the highest possible option), but this didn’t solve the problem for me, as Visual Studio appeared to be suppressing the error message(s) themselves.

As an alternative, you may try to use the raw output messages from the “Output” tab, which haven’t been filtered by Visual Studio. Either do an in-place search for the strings “error” and/or “failed”, or copy all of the output to your favorite text editor and do a search there.

To ensure that the Output window appears each time you do a build, you can go to Tools → Options → Projects and Solutions → General, and ensure that the option “Show Output Window when build starts” is checked.

As an additional troubleshooting step, it is also possible to build the project from the PowerShell command line by running dotnet build. This will show you the complete build output, including any errors that Visual Studio may be hiding.

Leave a Comment