Disabling auto-recompile in 2019.3 with VS 2019

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! :slight_smile:

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.

2 Likes

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?

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!

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

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