简体   繁体   中英

Build Errors in Visual Studio 2019 inconsistently show up in Error List

I recently updated from Visual Studio 2017 Community Edition to Visual Studio 2019 Community Edition.

Now, if I build my solution with errors, they will show up in the build output, but not all of them will appear in the error list. It would appear only errors of open files will show up in the error list. This is incredibly annoying.

I am not alone in this issue. It has been reported many times on Microsoft's forums, but no one has a definitive solution.

I have tried a variety of solutions people suggested in those threads:

  • I have ensured the filters are legitimate: Entire Solution, Errors enabled, Build + Intellisense.
  • I have tried deleting the.vs folder and restarting Visual Studio.
  • I just updated to the very latest Visual Studio 2019 version. Supposedly there are many different versions of this error, happening in versions of Visual Studio all the way back to 2017. Some supposedly have been fixed...?
  • I have disabled parallel project loading.

I have experienced this before in other versions of Visual Studio with Razor pages. To my knowledge, that's to be expected in Razor though.

The only other factor that I severely doubt impacts anything is that it's a Visual Studio project generated by Unity editor. From what I've read, ASP.NET, Razor, Xamarin, and other frameworks have each had their own version of issue reported. Perhaps Unity is afflicted by it too, but I don't see how or why. I doubt Unity's auto-generated Visual Studio projects are that different from your standard library projects.

For those using Visual Studio 2019 v16.9.1 make sure your Error List window looks something like this:

错误列表窗口

The important part for me was selecting Build + IntelliSense (previously it was set to Build Only which explains why the error list would only refresh on build).

I have now installed Visual Studio 2019 on two separate machines, and it appears that "Full Solution Analysis" is disabled by default.

Simply check the checkbox in options and everything seems to work as it did previously: 启用完整解决方案分析

In my case the solution was to switch off 'Tools->Options->Projects and Solutions->General->Show output window when build starts'. Even though the 'Output' window showed "0 succeeded, 1 failed" it would not switch back to the 'Error List' window even that the checkbox above 'Always show Error List if build finished with errors' should have moved it to 'Error List'. Clearly a bug in Visual Studio 2019 which was not present in Visual Studio 2017 (I just finished updating).

In my case, it was the fact that I was building under a Release profile. Once I chose Debug from the dropdown next to the Start Debugging button, it started showing my errors in the Error List after a few seconds.

In my case it was since the dependency dll was built for x86, but in the misbehaving project its reference was with processorArchitecture=MSIL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM