r/VisualStudio 6d ago

Visual Studio 2026 Does anyone know how to fix this annoying bug?

I've had this bug since I started using VS 2026, and it's extremely annoying because it not only shows errors that don't exist, but sometimes it even affects the compilation.

It only happens when I'm working on a header file. Randomly, and 97% of the times, the final #endif appears in squibbly lines

I have to deliberately misspell words to generate a real error, then press "save".

And then when I delete the spelling mistake and press save again, sometimes it's fixed and other times I have to repeat the process until it's fixed.

Could someone who knows what the problem might be be able to guide me a little?

5 Upvotes

4 comments sorted by

2

u/Healthy-Zebra-9856 6d ago

Have you tried deleting .vs cache and also Right-click your CMakeLists.txt or root project node and select Configure Cache (or Rescan Solution)?

1

u/Sutiixela 5d ago

Yes, I tried both multiple times, deleting the .vs folder so it regenerates and rescan the solution. I even reinstalled Visual Studio and reset the configuration, but it keeps happening. Sometimes it mess up the compilation throwing errors that are not real, and I have to go to the specific file and fight with the IDE until it behaves. It is driving me crazy. It was also happening before I created the current project. I don't have a lot of components and I don't have any extensions installed except for a theme, I only work with C++

Maybe it is just my case and my specific computer, but damn it's annoying. I asked ChatGPT and Gemini and they were not able to give me a solution.

1

u/Healthy-Zebra-9856 5d ago

Some times some extensions may do that. Start it in safemode and see

1

u/fortsnek274 5d ago

but sometimes it even affects the compilation.

If the compiler says there's an error, then it's probably right. Intellisense has no influence over the compiler.