MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Unity temporarily freezes up when opening Visual Studio from MRTKv2 projects

Open vmnetcetera opened this issue 6 years ago • 5 comments

Describe the bug

When using MRTKv2 with Unity and Visual Studio, Unity sometimes temporarily freezes up when opening or switching to the Visual Studio solution(e.g. double-clicking a C# script or selecting Assets->Open C# Project).

When this happens, Unity stays frozen up for a significant amount of time, usually 20+ seconds, sometimes up to a minute.

This doesn't happen every time the Visual Studio solution is opened, but always happens in the following cases:

  • The first time Visual Studio is opened after loading the Unity project.
  • The first time Visual Studio is opened after exiting Play Mode in Unity.

To reproduce

Steps to reproduce the behavior:

  1. Open up a Unity project that uses MRTKv2.
  2. Enter, then exit Play Mode in Unity.
  3. From Unity, open the Visual Studio solution for the Unity project, by either:
  • selecting Assets -> Open C# Project from the menu,
  • double-clicking a C# script in the Project window, or
  • double-clicking an entry in the Console window
  1. Unity will now stop responding for a while.

Expected behavior

Unity should not freeze up in the described scenario.

Screenshots

When this happens, Visual Studio sometimes shows the following notification: vs_tools_unity_warning

Your setup

  • Unity Version 2019.3.1f1
  • MRTK Version v2.3.0
  • Visual Studio Version 16.4.3

Also reproduced with other 2018 and 2019 Unity versions, and other MRTKv2.X versions.

Target platform

  • HoloLens 2

Additional context

The issue only seems to happen with the combination of Unity + Visual Studio + MRTKv2. This issue does not occur when using VS Code, or in Unity projects not using MRTKv2.

vmnetcetera avatar Apr 21 '20 11:04 vmnetcetera

Likely a side effect of the number of assemblies we have. @davidkline-ms more data for possibly reconciling some of our assemblies and reducing the number.

keveleigh avatar Apr 21 '20 16:04 keveleigh

Posting back after a while here - there's some solutions that we're exploring now that should help with this, though we're probably a little ways out (i.e. big-O of months) to having this materialize). Consuming MRTK as a .unitypackage (i.e. potentially mutable sources) means that Unity also does diff detection + project generation against MRTK code despite the likely case that you aren't actually mutating MRTK code means you still end up getting affected by that.

wiwei avatar Jun 11 '20 19:06 wiwei

Like @keveleigh says trillion of projects are reloaded in VS. This is really a major performance killer for development with MRTK2.

tommensink avatar Jul 15 '20 05:07 tommensink

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

stale[bot] avatar Dec 24 '20 11:12 stale[bot]

This issue has been closed by an automated process because it is stale. If this is still an issue please add a new comment with more recent details and repro steps.

stale[bot] avatar Apr 19 '22 07:04 stale[bot]