'Visual Studio 2022 .razor code block is flickering

I am using Visual Studio 2022 Enterprise. While working with .razor files I have a strange flickering.

Since a while my syntax highlighting is broken. As you can see in the image below it is a constant flickering of the highlighting. Does anyone knows how to get rid of the flickering in a .razor file in C#. This behavior is occurring in some of the file, not in all.

I have already rebuild and clean up the project. Closing VS or the tab does not work either.

enter image description here

Ignore the code content, that is still in development :)



Solution 1:[1]

See this page. A fix for this issue has been released! Install the most recent release from https://visualstudio.microsoft.com/downloads/.

Update to 17.2 can solve the problem.

Solution 2:[2]

While update 17.2 makes it a little better the workaround for now is to maximize all collapsed code blocks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jingmiao Xu-MSFT
Solution 2 Christian O.