How do I prevent Visual Studio from duplicating errors in the error list?

1.2k views Asked by At

I have looked up this question but none of the other answers have worked for me.

I am getting duplicate messages in the error list on VS2019. I do not think it is every error and when I first open my project it doesn't do it but once I open up a XAML file it stays like that. The code raising the errors does not need to interact with the XAML file in any way (It happens on newly created classes).

One answer said it may be IntelliSense and the Compiler reporting the same error but I've always had IntelliSense + Compiler on and this problem has only been around 1-2 months. Plus I switched to IntelliSense Only and am still getting double errors.

Duplicated messages from "XamlInProcLanguageClient"

The duplicates always come from XamlInProcLanguageClient but a google search shows a single result when I google it.

Additional Info:

  • It happens on new projects and old projects.
  • I have reset my settings and the problem still persists.
  • My MSBuild project build output verbosity is "Minimal"
  • If I close and reopen the solution, the duplicates go away until a xaml file is opened.

The only thing I could think I did around 1-2 months ago that might affect this is that I downloaded VS 2022 Preview (2.1 or 3). However, I never actually opened it and have uninstalled it to attempt to fix the problem (without luck).

2

There are 2 answers

1
Michael Wagner On BEST ANSWER

I was able to find this issue posted on the Microsoft Developer Community here, so it appears to have been a bug:

Intellisense content is repeatedly displayed

It says "fixed" in 17.0 which is just VS2022 and I have tested 16.11.7 (VS2019) and the problem persists. It does appear to be fixed in VS2022 so the answer is to upgrade.

2
Tianyu On

If you select Build Only, I believe the duplicated errors(error messages) will gone.

Looks like the duplicated error messages are not from Build/Compile, instead, I think they are from IntelliSense or one of the features which is for Xaml in IntelliSense. This may be a feature of Visual Studio, and designed like this. Up to now, I haven’t found any option to turn off this feature. Switch to Build Only may help to filter it, and it seems they always appear with duplicated messages and once you solve the errors the Compiler points, then they will both disappear.

If you need an explanation for this feature, I suggest you ask in Microsoft Developer Community, where VS Product Team may give you an explanation.

enter image description here

enter image description here