Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Disabling auto-recompile in 2019.3 with VS 2019

Discussion in 'Editor & General Support' started by pdinklag, Feb 18, 2020.

  1. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    143
    Am I missing something, or has something changed recently concerning automatic recompiling and the Auto Refresh option? I couldn't find anything on this topic specifically, hence I'm asking.

    So I want to be able to edit scripts in Visual Studio without them being recompiled instantly on every single change. I just want to trigger recompilation manually. To achieve this, in Unity 2019.2 with VS 2017, I disabled Auto Refresh option in the editor preferences. This way I could edit scripts and they wouldn't recompile until I hit CTRL+R in the editor.

    This doesn't seem to be possible anymore. I upgraded to Unity 2019.3 and VS 2019 and did disable Auto Refresh, however, whenever I do the slightest change to any script file, a recompilation is triggered. Is this intended behaviour? Is there something I need to do in VS that I forgot about? Is there any other way to avoid this?

    Any help would be appreciated! :)
     
  2. Terraziel

    Terraziel

    Joined:
    May 10, 2013
    Posts:
    1
    There is a setting in VS2019 under Options, Tools For Unity, called "Refresh Unity's AssetDatabase on save"

    Disable this makes editing much easier, but Unity still seems to Auto-Refresh when you switch back to the Unity window.
     
    codegasm and pdinklag like this.
  3. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    143
    Weird, I checked those options and must have missed that one. Thank you!
    For anyone reading this, apparently you have to restart VS after changing that option in order for the change to come into effect.

    Hm, for me it's working exactly like I want it now, only refreshing when I hit refresh. You did disable that Auto Refresh option I mentioned in my original post, right?
     
  4. EthanFischer

    EthanFischer

    Joined:
    Feb 10, 2016
    Posts:
    46
    I disabled VS Tools for Unity and auto refresh and it still shows me the 'Importing' loading bar everytime I build in VS and hit play in unity.

    Help!
     
  5. EthanFischer

    EthanFischer

    Joined:
    Feb 10, 2016
    Posts:
    46
    I even disabled VS Tools entirely, and tried unity 2017 with no VS Tools. It seems to be an issue with unity 2019, not VS
     
  6. EthanFischer

    EthanFischer

    Joined:
    Feb 10, 2016
    Posts:
    46
    Okay turns out one of the packages in my project (MRTK) was attaching to the UnityEditor.onPlay event and triggering AssetDatabase.Refresh()

    Disabling this bit of code fixed my issue