VS Community 2019 auto saves scripts and freezes for a few seconds when opening a script in 2021 LTS

I didn’t have this issue on previous Unity versions. Sometimes, when I double click a script in Project window or click a stacktrace line in Console window, Visual Studio freezes for a few seconds. When it finishes whatever it’s doing, it auto-saves all my open scripts (if they had any unsaved changes) and the “changed line indicators” in all my scripts are gone (yellow indicators for unsaved lines and green indicators for modified lines).

Using 2021.3.18f1 with Visual Studio Editor 2.0.17 package.

EDIT: The issue was caused by a class that extends WebClient that came with a plugin. For unknown reasons, Visual Studio would add <Subtype>Component</Subtype> to that class inside .csproj file and sometime later, it would delete it. Since this change modified the .csproj file, that’d trigger the VS project reload. I’ve removed that class from the project and the issue is resolved.