Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

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

Discussion in 'Code Editors & IDEs' started by yasirkula, Mar 16, 2023.

  1. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,901
    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.
     
    Last edited: Mar 29, 2023
  2. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,901
    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.
     
    Last edited: May 12, 2023