Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

"Unloading broken assembly" error at each compilation

Discussion in '2018.3 Beta' started by jeremies_unity, Dec 3, 2018.

  1. jeremies_unity

    jeremies_unity

    Joined:
    Oct 16, 2018
    Posts:
    26
    Since b11, I get this error on each compile and/or play:

    Unloading broken assembly Packages/com.unity.incrementalcompiler/Editor/Plugins/Unity.PureCSharpTests.dll, this assembly can cause crashes in the runtime

    I tried deleting the package cache and starting from scratch but it keeps popping. Doesn't happen with b10 and below.

    Happens with a new blank project with the IncrementalCompiler package installed.
     
    Last edited: Dec 3, 2018
  2. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Unloading broken assembly Packages/com.unity.incrementalcompiler/Editor/Plugins/Unity.PureCSharpTests.dll, this assembly can cause crashes in the runtime
     
  3. Dom_Laflamme

    Dom_Laflamme

    Unity Technologies

    Joined:
    Sep 25, 2013
    Posts:
    27
    Which version of the incremental compiler are you using?
     
  4. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Latest 29. Had to unistall it since it also brakes our editor newtonsoft dll.
     
  5. icepick912

    icepick912

    Joined:
    Jul 8, 2010
    Posts:
    58
    Same here, I get the error when trying to get assemblies for some reflection work using "System.Assembly.GetTypes();" using latest build 29 as well.

    Code (CSharp):
    1.  
    2. using System.Reflection;
    3. using System.Collections.Generic;
    4. using System;
    5. using UnityEngine;
    6.  
    7. public static class ReflectionHelpers
    8. {
    9.     public static System.Type[] GetAllDerivedTypes<T>(this System.AppDomain aAppDomain)
    10.         where T : MonoBehaviour
    11.     {
    12.         var result = new List<System.Type>();
    13.         var assemblies = aAppDomain.GetAssemblies();
    14.         foreach (var assembly in assemblies)
    15.         {
    16.             //Debug.Log(assembly.Location);
    17.             /* Workaround commented out to reproduce error
    18.             try
    19.             {
    20.                 if (assembly.Location.Contains("PackageCache"))
    21.                     continue;
    22.             } catch { continue; }
    23.             */
    24.  
    25.             var types = assembly.GetTypes();
    26.             foreach (var type in types)
    27.             {
    28.                 if (type.IsSubclassOf(typeof(T)) && !type.IsAbstract && type.IsClass)
    29.                     result.Add(type);
    30.             }
    31.         }
    32.         return result.ToArray();
    33.     }
    34. }
     
    Last edited: Dec 5, 2018
  6. mrmcduck

    mrmcduck

    Joined:
    Nov 26, 2015
    Posts:
    26
    +1

    Using 2018.3.11 and p.29, error is constantly present, but hasn't caused any issues for me so far.
     
  7. Dom_Laflamme

    Dom_Laflamme

    Unity Technologies

    Joined:
    Sep 25, 2013
    Posts:
    27
    working on a fix. stay tuned.
     
    optimise likes this.
  8. Dom_Laflamme

    Dom_Laflamme

    Unity Technologies

    Joined:
    Sep 25, 2013
    Posts:
    27
    This is caused by a breaking change in one of Unity's internal API.
    I've released version `0.0.42-preview.30` which works with 2018.3.b11++, but breaks compatibility with previous 2018.3 betas.
    For support for 2018.3.b10 and lower, please use 0.0.42-preview.29.
     
  9. jeremies_unity

    jeremies_unity

    Joined:
    Oct 16, 2018
    Posts:
    26
    Works great in b12. Thanks!
     
  10. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Works for me. Thank you.
     
  11. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Dom, have one question. May I ask you what compiler command line tool in unity installed directory you use to compile NET4.x or NETSTANDARD2.0 assemblies? Like Unity.app/Contents/??? In the past we used mcs but that has change with the new 2018.3.
     
  12. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    The fix works but the incremental compiler takes ages to compile things compared if I remove it.