Search code examples
visual-studiounity-game-enginevisual-studio-2019

Unity3D with Visual Studio 2019 - Auto Refresh


This feels like a slightly off topic question but have asked on.. Unity Answers, Unity Forum, Super User and MS Visual Studio Support and not got a reply anywhere, so hoping with the amount of developers here someone might have come across this and have an answer.

Is there a setting I'm missing for a project in Visual Studio to auto refresh/reload when adding a new C# file from the Unity3D Editor?

With the previous bundled version of Visual Studio that came with the Unity3D Editor it would do this but after upgrading to Visual Studio 2019 I have to manually "reload" the project from within Visual Studio which undoes any unsaved changes.

Thanks.


Solution

  • When I installed Visual Studio 2019 the Unity Tools Extension wasn't an optional add-on.

    Since then it has become one and adding that using the Visual Studio Installer to modify the existing installation and then setting the "Automatic project reloading" option within the Unity tools Extension to true fixed the issue.

    Solution Steps.

    Step 1: Open the Visual Studio Installer and select Modify

    Fix Step 1

    Step 2: Scroll down to the Game development with Unity extension.

    Fix Step 2

    Step 3: Once the extension is installed open the option window (Tools -> Options)

    Then find the Tools for Unity tab and set Automatic project reloading to true

    Fix Step 3

    Step 4: Restart Visual Studio

    Hope this helps anyone else that runs into this and is unable to find any answers as was the case with me.