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.

Constant, incessant"Reload Script Assemblies" - Program crashing, hanging

Discussion in 'Editor & General Support' started by Smileyfrown, Feb 14, 2021.

?

Does your Unity constantly "Reload Script Assemblies"

  1. Yes and crashes/Stops responding

    288 vote(s)
    53.0%
  2. No

    5 vote(s)
    0.9%
  3. Yes and does NOT crash/stop responding

    250 vote(s)
    46.0%
  1. Smileyfrown

    Smileyfrown

    Joined:
    Nov 29, 2018
    Posts:
    2
    Sometimes just starting Unity causes "Reload Script Assemblies" to start, and never finish. Right now as I'm typing this it says "Reload Script Assemblies (busy for 17:00)...".

    I just installed Unity last night, 2020.2.3f1. The "Reload Script Assemblies" problem was noticed the very first time I ran it. I clicked "Play" on the default empty canvas and it started "Reload Script Assemblies" before I even changed anything, I had to end it in task manager.

    Today, I updated to 2020.2.4f1. Made a new project, added a script that changes text when a key is pressed, but didn't even have to hit "Play" for it to "Reload Script Assemblies" and hang. Attached is an image showing task manager as well as the Unity interface.


    What do I have to do to get this program to work?

    My pc specs if you want them:
    (All components are default)
    Ryzen 7 3700x
    2x8gb 3600 cl16 ram
    AMD RX 5700 GPU
    And Unity is installed on (and projects are located on): WD Black NVMe M2 2280 1TB SSD


    What I have tried so far:
    Restarting computer
    Uninstalling/Reinstalling
    Updating Unity
    Changing install location, as well as project save location.
    Monodevelop - Visual studio(problem persists in both)


    Also, when Unity does work, and allow me to make a single change, it still "Reload Script Assemblies" after every change I make. Whether it's in visual studio, or in Unity itself.
    Add Gameobject - 30 seconds of "Reload Script Assemblies"
    Change size of Gameobject - 30 seconds of "Reload Script Assemblies"
    Literally do anything - 30 seconds of "Reload Script Assemblies"
    But as I said in the title >50% of the time, "Reload Script Assemblies" makes Unity Stop Responding.
    I can't even save my scene fast enough to not lose what I'm doing because "Reload Script Assemblies" starts so fast after changing anything.

    Please help

    I'm adding a Poll as well to see if this is a frequent occurrence for many users or just me since I have been unable to find any information about this except from a post from 2 years ago which got 0 replies.

    Unityproblem.png
     
    tonytopper and webik150 like this.
  2. Smileyfrown

    Smileyfrown

    Joined:
    Nov 29, 2018
    Posts:
    2
    I solved it by going to 2019.4.20f1 LTS version of Unity
     
    RadianSmile likes this.
  3. shastarama

    shastarama

    Joined:
    Jul 31, 2017
    Posts:
    2
    I tried downgrading as well but lost a bunch of data so had to go back to the new version. Waiting up to a minute every time you leave Visual Studio is a major bug that costs tons of lost time...
     
    GameJing and AliceWasNeverHere like this.
  4. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    638
    The same thing is happening on 2020 LTS. The only, way to stop is to end the task on Unity. Anything unsaved in the scene is lost
     
    wehuffman15 and fdefalco like this.
  5. Xavier78

    Xavier78

    Joined:
    Oct 13, 2013
    Posts:
    35
    I have a version of this happening, It does "Stop", but it just recompiles over and over and over.
     
  6. Xavier78

    Xavier78

    Joined:
    Oct 13, 2013
    Posts:
    35
    I did just get the fallowing error after recompile took 5 minutes.
    An infinite import loop has been detected. The following Assets were imported multiple times, but no changes to them have been detected. Please check if any custom code is trying to import them:

    Assets/Packages_External/Plugins/DarkTonic/MasterAudio/Scripts/Settings/AddressableDelayedRelease.cs - (Force Reimport)
    Assets/Packages_External/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Inspectors/Triggers/Legacy/AlertTriggerEditor.cs - (Force Reimport)
     
    Last edited: Jun 28, 2021
  7. Xavier78

    Xavier78

    Joined:
    Oct 13, 2013
    Posts:
    35
    @FlightOfOne @shastarama @Smilefrown
    Can you all get me a list of your packages/plugins? I am thinking at least me side is one of them causing an error.
     
  8. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    638
    Is there an easy way to get a list?

    By the way, I get no errors. Just sits there.
     
  9. Xavier78

    Xavier78

    Joined:
    Oct 13, 2013
    Posts:
    35
    unity made ones from the package manager will show up in Packages/manifest.json, and then any unity asset store ones if installed through package manager I am not sure(pretty sure you will just have to look through folders/plugins folder to find the names).
     
  10. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    343
    I encounter this in 2021.1.13 and later A LOT recently. Really caused me some lost work because this reloading assemblies dialog cannot be cancelled, so tough luck if you didn't save your scene when unity decides this.

    Sometimes it does it again and again, sometimes it never stops. (normal time is a few seconds).
    I suspect it's got something to do with Rider, maybe.

    But I also got tremendous issues with the search field now, which gives me annoying cascading "busy" progressbar dialogs, too, often diminishing editor interactivity until I clear my search query.

    What exactly was wrong with the original search? :p
     
  11. gwelkind

    gwelkind

    Joined:
    Sep 16, 2015
    Posts:
    39
    This is happening with me as well-- I've noticed it reloads assemblies whenever I move an object in the editor or change any serialized property. Also sometimes when I'm just startdrag an object from the hierarchy.

    I'm using Jetbrains Rider as well. One notable thing about my setup is that I have my main code in a designated "Source" file with it's own assembly. I'm not intimately acquainted w/ either software but I'm wondering:

    1. Is it Rider which is initiating assembly reload events? Is there a way to tell where an assembly reload event was invoked?
    2. If the above, I wonder if there's a way we could profile Rider to see if something is incorrectly configured.
    I would be interested if any of you are also using Rider or have your code scoped into an .asmdef

    Uploaded my manifest.json
     

    Attached Files:

    ChiuanWei likes this.
  12. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    638
    You can use the profiler in the editor (for editor), maybe something would show up there.

    I never had this issue in 2019. 2020 onward is the problem I think.

    One thing I recently realized is that the editor performance has a lot to do with the read/write speed of your disk too (and not having too low space). I recently moved my project to a faster drive (that is not C:\ so it is not constantly accessed by other programs) and things improved.

    What we need is a cancel button. This is not a solution perse but at least we won't lose work.
     
  13. twebster

    twebster

    Joined:
    Jan 17, 2020
    Posts:
    2
    Just to add to the noise, I'm also seeing this pretty constantly in 2021.1.16f1. I've been seeing it since at least 2021.x.x, but I skipped over most of 2020, so could have been there as well.

    I hate dropping back to 2019, but this is costing me time.

    As far as drives are concerned, I'm running on an SSD, with 180GB to spare.
     
  14. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    222
    I'm getting "reload script assemblies" every time a line of change is made in the code and I return to the Editor. It never used to do this in previous Unities. (2020.3.15f2)
     
  15. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    638
    I waste about 30 mins on a good day dealing with unity editor issues. I don't know who's idea it was to put these bars that prevent any input without having a cancel button. Because when the never end and you haven't saved the scene, you lose everything up to that point.
     
    Westland, FlavioIT and Romenics like this.
  16. mastermemorex

    mastermemorex

    Joined:
    Nov 5, 2017
    Posts:
    6
    Any progress with this issue? In the last update, everytime I click play event without changing a single line in the scripts I loose a lot of time looking a progress bar... hold on busy... reloading assemblies...
     
  17. goldfishrock

    goldfishrock

    Joined:
    Jun 8, 2020
    Posts:
    1
    Still not fixed! Aghhhhhhhhhhh............. it's driving me nuts!
     
  18. Abdo023

    Abdo023

    Joined:
    Dec 18, 2017
    Posts:
    64
    I keep getting this and My project can't downgrade to the 2019 version. Help!!
     
  19. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    "Reload Script Assemblies..." each time I press the play button, each.time. Unity 2022 Alpha.
     
  20. crekri

    crekri

    Joined:
    Sep 7, 2015
    Posts:
    18
    In my case, it seems to be a problem caused by some configuration error caused by the DOTween pro asset, and deleting the asset stops the problem from ever happening again.

    Recently I switched my work machine from windows to mac, and I also updated the project from 2019 to 2020. When I first open the project in the 2020 editor, I got a lot of error messages, but I naively dismiss it. (There seems to be some error regarding script assemblies - but I didn't pay much attention)

    Since then, the error messages no longer appears, but I also get into the constant 'reload script assembly' and hanging problem. I finally decided to perform a clean git clone (i.e. delete libaray, obj and package cache folders), and the error messages related to script assemblies show up again. I forget what the exact error is (I don't have the time to reproduce the problem, sorry), but it has something to do with DOTween Pro and script assemblies. Since we are in a crunch, and we don't really need to use DOTween pro, we simply deleted the asset and the problems disappear.

    In case someone else also have the same problem on their existing projects, try to perform a clean clone and pay attention to the error messages that shows on first import. It may provide hints on what causes it.
     
  21. TheSwanCollective

    TheSwanCollective

    Joined:
    May 6, 2016
    Posts:
    26
    Yes. Empty clean project in 2021. Hit Play. "Reload Script Assemblies". Makes Unity unusable wth!?
     
  22. billw2011

    billw2011

    Joined:
    Apr 5, 2014
    Posts:
    15
    Yep using 2020.3.23f1 and I dread switching back to editor. Am I going to have to find something else to do for 60+ seconds before I can continue? Like maybe go on the forums and complain about this issue? My project is barely even a mini tech demo yet, this isn't a problem caused by how much scripts or content I have there is some bug or poorly thought out code causing this problem, it was fine in 2019 for the same project.

    I'm using Rider, but I haven't used any custom asmdef in this project yet. It seems to be worse if I have Rider connected to Unity when I switch back, but I can't be sure. Either way its not acceptable for Unity to let any external tool break the workflow like this, the dialog should be cancel-able or non-blocking.

    Pulled this from the logs, not particularly useful...
    Code (CSharp):
    1.  
    2. RefreshProfiler: Total: 39.834ms
    3. - Completed reload, in 145.454 seconds
    4. Domain Reload Profiling:
    5.     ReloadAssembly (145455ms)
    6.         BeginReloadAssembly (143866ms)
    7.             ExecutionOrderSort (0ms)
    8.             DisableScriptedObjects (36ms)
    9.             BackupInstance (0ms)
    10.             ReleaseScriptingObjects (0ms)
    11.             CreateAndSetChildDomain (142ms)
    12.         EndReloadAssembly (1548ms)
    13.             LoadAssemblies (143695ms)
    14.             RebuildTransferFunctionScriptingTraits (0ms)
    15.             SetupTypeCache (154ms)
    16.             ReleaseScriptCaches (1ms)
    17.             RebuildScriptCaches (83ms)
    18.             SetupLoadedEditorAssemblies (568ms)
    19.                 LogAssemblyErrors (0ms)
    20.                 InitializePlatformSupportModulesInManaged (4ms)
    21.                 SetLoadedEditorAssemblies (0ms)
    22.                 RefreshPlugins (1ms)
    23.                 BeforeProcessingInitializeOnLoad (112ms)
    24.                 ProcessInitializeOnLoadAttributes (441ms)
    25.                 ProcessInitializeOnLoadMethodAttributes (7ms)
    26.                 AfterProcessingInitializeOnLoad (3ms)
    27.                 EditorAssembliesLoaded (0ms)
    28.             ExecutionOrderSort2 (0ms)
    29.             AwakeInstancesAfterBackupRestoration (411ms)
    30.  
     
    Last edited: Dec 12, 2021
  23. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    I'm so much used now to getting these "Reload Script Assemblies" that it feels normal... Using 2021.1.0a16.
     
  24. billw2011

    billw2011

    Joined:
    Apr 5, 2014
    Posts:
    15
    Are you using Rider? I think I have managed to track my issue down to having Rider attached to the editor. I can reproduce the freeze pretty reliably I think.
     
  25. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    No, I'm not.
     
  26. NTG-Sera

    NTG-Sera

    Joined:
    Sep 13, 2019
    Posts:
    7
    Disable `Directory Monitoring` in Editor Preferences, in 2019 to 2020 unity versions this is incurring Package Manager script and assembly reloads regardless of changes. Flagging this off in my personal project reduced my compile times from 36~ seconds to near instant and my work project's compile times were reduced by about 4.5x.

    With Domain and Scene compilation reloading disabled and sub assemblies for all code in my project, I'm nearly ecstatic that Unity is actually *FAST* ( read: near instant ) for the first time in ever.
     
    chipb and stestar like this.
  27. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    Thanks but I cannot find this in the preferences, where is it?
     
  28. NTG-Sera

    NTG-Sera

    Joined:
    Sep 13, 2019
    Posts:
    7
    upload_2021-12-13_12-2-33.png

    I am on 2020.3.21f1 LTS, but I know in future versions of Unity they've removed both Auto Refresh and Directory Monitoring from here. However you can access either from their Editor Preferences values:

    Code (CSharp):
    1. m_AutoRefresh = EditorPrefs.GetBool("kAutoRefresh");
    2. m_DirectoryMonitoring = EditorPrefs.GetBool("DirectoryMonitoring", true);
     
    Last edited: Dec 13, 2021
    NotaNaN, chipb, stestar and 2 others like this.
  29. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    Thanks! I'm bookmarking the script for further investigation. :)
     
  30. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    102
    I added MySQL.Data.dll to my project. If I don't close the connection or a reader then the second time I run in the editor it will hang and be endlessly reloading assembly. If I make sure everything gets closed then it is good. Just took awhile to figure that out.
     
    Hackfruchtsalat likes this.
  31. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    122
    i am the same of your case.... and i don't know why it cost more and more times to reload the script even click the play button in editor.........................that's make me crazy!!!
     
  32. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    122
    i don't got this setting in unity2021.2.6f1....
     
  33. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    I tried and override:
    Code (CSharp):
    1. private void ReadAssetImportPreferences ()
    2. {
    3.     m_DirectoryMonitoring = EditorPrefs.GetBool ("DirectoryMonitoring", true);
    4. }
    but I can't: it's private and, as far as I know, there is no way to make it accessible from outside, is there?
     
    Ksanone likes this.
  34. qCring

    qCring

    Joined:
    Jan 9, 2017
    Posts:
    7
    Same here with Unity 2022.1.0b2 and VSCode, so this seems not Rider-specific.
    Setting the preferences via UnityEditor.EditorPrefs.SetBool ( ... ) didn't help (even though those prefs were initially set to true) but that might be pre-existing values from the older version.

    Is there anything we can do, like reporting a bug for this issue?
     
    Westland and Ksanone like this.
  35. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    557
    This happens when pressing play on an empty project and an empty scene in Unity 2021.2.7f1
    I tried making a URP and BIRP project but they both are afflicted by incessant Rebuild Script Assemblies.
     
    Ksanone likes this.
  36. grentle

    grentle

    Joined:
    May 14, 2016
    Posts:
    7
    These two values are in the Asset Pipeline category now.
     
    stestar and Ksanone like this.
  37. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    Really? I'll have to take a look then!
    Thanks for the tip!

    Edit: Indeed! But disabling "Directory Monitoring" is only for Windows right now...

    Capture d’écran_2022-01-06_17-46-12.jpg
     
    Last edited: Jan 6, 2022
    Ksanone likes this.
  38. Orbe99

    Orbe99

    Joined:
    Mar 9, 2020
    Posts:
    1
    thats not solving the problem its passing to another version
     
    Ksanone and qCring like this.
  39. v2-Ton-Studios

    v2-Ton-Studios

    Joined:
    Jul 18, 2012
    Posts:
    230
    Just wanted to drop in here and say +1... facing the same issues noted above. Also, as already noted, this is a major drain on productivity.

    @Unity For what it's worth... performance, especially of the core iterative loop of "edit code" --> "test said code", is insanely high priority for me as a user and customer of Unity.

    Examples:

    I just duplicated a material in the hierarchy view, selected material press Ctrl + D. It took nearly 50 seconds.

    Updating menu items... 3s
    Resolving packages... 42s
    Then some menu and view refresh stuff
     
    Last edited: Jan 17, 2022
    NotaNaN, Westland, lyzard and 2 others like this.
  40. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    557
    On my current project I often have to move the Unity editor between my main monitor and my second monitor.
    Every time I do this, Unity does the "Reload Script Assemblies" thing! It's infuriating.
     
  41. lcompton

    lcompton

    Joined:
    Mar 31, 2018
    Posts:
    50
    I was able to solve this in one of my projects by deleting the C# Solution file (the file suffixed with ".sln") in the project directory. I also removed the ".csproj" files, although I doubt that had any impact. I don't know if the fix will be permanent, but the problem has not yet reemerged since I deleted the file and let Unity rebuild it.
     
  42. lcompton

    lcompton

    Joined:
    Mar 31, 2018
    Posts:
    50
    What I was experiencing was the "Reload Script Assemblies" window never going away. Once I removed the ".sln" file, Unity returned to its old self. The reload script assembles process is not particularly fast (10s of seconds), but at least it finishes and I don't have to kill the editor and restart it.
     
  43. PrimePeter

    PrimePeter

    Joined:
    Oct 4, 2019
    Posts:
    1
    Im Experiencing the same problem, endless Reload Script Assemblies everytime I change code, with Unity 2020.3.15f2.

    tried editing code in VS, VS-Code and Notepad++ (with the respective other IDEs closed) , doens't make any difference

    Im using both:
    - Jetbrains rider Package 2.0.7
    - MySQL.Data.dll Version 8.0.11

    Removing the .slnf file doesn't helped me

    deactivating "Directory Monitoring" doesn't helped me

    Disposing all objects which are using MySQL.Data after first run after clean start of Unity doesn't helped me

    I'm close to moving to 2019. I cant afford this any further.
     
  44. mediamax07

    mediamax07

    Joined:
    May 22, 2017
    Posts:
    7
    You can use Windows RegEdit to modify the EditorPrefs values; Haven't tried it but it works most of the time for me to check for current values

    Regedit path: HKEY_CURRENT_USER\Software\Unity Technologies\UnityEditor 5.x

    On Mac OS X, EditorPrefs are stored in ~/Library/Preferences/com.unity3d.UnityEditor.plist.

    You can read more from this link: https://docs.unity3d.com/ScriptReference/EditorPrefs.html
     
  45. mediamax07

    mediamax07

    Joined:
    May 22, 2017
    Posts:
    7
    I recently upgraded my project from 2019.4 to 2020.3 which I thought moving to another stable version, but to my knowledge it caused problems since I did.
    Most of the time (more than 50%) when the editor starts compiling, "Reloading Assemblies" progress shows up & then the Unity editor crashes (doesn't freeze, literally crashes & shows the Unity Bug Reporter).

    Tried deleting Library/Obj/Temp... directories, nothing changed, deleted solution files & re-generating them again, same, tried re-installing Unity multiple times, even deleted the Unity Hub, no chance, re-installed Visual Studio 2022, even tried Visual Studio 2019 and VSCode, same, it doesn't seem to be an IDE problem, as people mentioned in this thread.

    When I checked the Unity log files, I found the following, though not sure if it's the cause of the issue.
    Preloading 0 native plugins for Editor in 0.00 ms.


    Here's the full log from the start:

    Start importing Assets/Scripts/Utilities/Editor/EditorUtilities.cs using Guid(58ddcf02d538531428e52ead91567ce0) Importer(-1,00000000000000000000000000000000) -> (artifact id: 'bd71d501e9016354989d5250d5483828') in 0.025694 seconds
    Start importing Assets/Scripts/MVC/Runtime/VehicleManager.cs using Guid(6af017a68d200a041a35022fa9bc5d3f) Importer(-1,00000000000000000000000000000000) -> (artifact id: '06f7569fc934dae976bc6366de783393') in 0.017374 seconds
    AssetDatabase: script compilation time: 0.158050s
    - Starting script compilation
    - Starting compile Library/ScriptAssemblies/Assembly-CSharp.dll
    Deleting stamp file at Library/ScriptAssemblies/BuiltinAssemblies.stamp
    - Finished compile Library/ScriptAssemblies/Assembly-CSharp.dll in 2.883445 seconds
    - Starting compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll
    - Finished compile Library/ScriptAssemblies/Assembly-CSharp-Editor.dll in 2.239036 seconds
    - Finished script compilation in 5.198956 seconds
    Reloading assemblies after forced synchronous recompile.
    Begin MonoManager ReloadAssembly
    Native extension for WindowsStandalone target not found
    Refreshing native plugins compatible for Editor in 1.76 ms, found 5 plugins.
    Preloading 0 native plugins for Editor in 0.00 ms. <======= This seems to be what's causing the issue
    Stacktrace:


    =================================================================
    Got a SIGSEGV while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    Crash!!!
    SymInit: Symbol-SearchPath: '.;C:\Users\media\Desktop\Unity Projects\Multiversal Vehicle Controller;C:\Program Files\Unity\Hub\Editor\2020.3.29f1\Editor;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 534, UserName: 'media'
    OS-Version: 10.0.0
    C:\Program Files\Unity\Hub\Editor\2020.3.29f1\Editor\Unity.exe:Unity.exe (00007FF6CF1D0000), size: 83283968 (result: 0), SymType: 'PDB', PDB: 'C:\Program Files\Unity\Hub\Editor\2020.3.29f1\Editor\Unity_x64.pdb', fileVersion: 2020.3.29.61817

    And the list of loaded DLLs goes on...


    I've already reported this error to Unity multiple times, about few days ago, still didn't get any response.
     
  46. iMobCoding

    iMobCoding

    Joined:
    Feb 13, 2017
    Posts:
    132
    qCring likes this.
  47. APSchmidt

    APSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    4,314
    No,I can't do that. :)
     
  48. Duffay

    Duffay

    Joined:
    May 14, 2019
    Posts:
    1
    Cleaning GI Cache solved it for me. (for now)
     
  49. alphabeta314

    alphabeta314

    Joined:
    Jul 23, 2015
    Posts:
    42
    Reload Script Assemblies (busy for 6 hours right now)...
    If I close unity and reopoen it reloads them super fast < 1 sec, but eventually it hangs
    Unity 2021.2.16f1
     
  50. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    52
    This issue is extremly annoying. For me it happens about 80% of times I enter play mode.

    Temp fix I found: If I alt-tab into Visual Studio and save any file there (even with no changes), the Reload Script Assemblies window will finish in a few seconds.
     
unityunity