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

Bug Assembly-CSharp.DLL not generating, but only on one machine

Discussion in 'Entity Component System' started by diesoftgames, Aug 20, 2023.

  1. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    114
    I have a branch updating my current project to 2022.3, and it worked out with no problems on one machine, but on another, when trying to open this branch with the 2022.3, I get an error that as far as I can tell, isn't pointing at a problem with my code or any of my third party code. Here is the entirety of the error report:

    Code (CSharp):
    1. Processing assembly Library/Bee/artifacts/1900b0aE.dag/Assembly-CSharp.dll, with 116 defines and 294 references
    2. processors: Unity.Entities.CodeGen.EntitiesILPostProcessors, Unity.Jobs.CodeGen.JobsILPostProcessor, zzzUnity.Burst.CodeGen.BurstILPostProcessor
    3. running Unity.Entities.CodeGen.EntitiesILPostProcessors
    4. running Unity.Jobs.CodeGen.JobsILPostProcessor
    5. Unity.Jobs.CodeGen.JobsILPostProcessor: ILPostProcessor has thrown an exception: System.ArgumentNullException: Value cannot be null. (Parameter 'fieldType')
    6.    at Mono.Cecil.Mixin.CheckType(Object type, Argument argument)
    7.    at Mono.Cecil.FieldReference..ctor(String name, TypeReference fieldType)
    8.    at Mono.Cecil.MetadataReader.ReadField(UInt32 field_rid, Collection`1 fields)
    9.    at Mono.Cecil.MetadataReader.ReadFields(TypeDefinition type)
    10.    at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
    11.    at Mono.Cecil.TypeDefinition.get_Fields()
    12.    at Mono.Cecil.ImmediateModuleReader.ReadFields(TypeDefinition type)
    13.    at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
    14.    at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
    15.    at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
    16.    at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
    17.    at Mono.Cecil.ImmediateModuleReader.ReadModule(ModuleDefinition module, Boolean resolve_attributes)
    18.    at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read)
    19.    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    20.    at Unity.Jobs.CodeGen.JobsILPostProcessor.AssemblyDefinitionFor(ICompiledAssembly compiledAssembly)
    21.    at Unity.Jobs.CodeGen.JobsILPostProcessor.Process(ICompiledAssembly compiledAssembly)
    22.    at Unity.ILPP.Runner.PostProcessingPipeline.PostProcessAssemblyAsync(PostProcessAssemblyRequest request, Action`2 progressSink)
    23. PostProcessing failed: System.ArgumentNullException: Value cannot be null. (Parameter 'fieldType')
    24.    at Mono.Cecil.Mixin.CheckType(Object type, Argument argument)
    25.    at Mono.Cecil.FieldReference..ctor(String name, TypeReference fieldType)
    26.    at Mono.Cecil.MetadataReader.ReadField(UInt32 field_rid, Collection`1 fields)
    27.    at Mono.Cecil.MetadataReader.ReadFields(TypeDefinition type)
    28.    at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
    29.    at Mono.Cecil.TypeDefinition.get_Fields()
    30.    at Mono.Cecil.ImmediateModuleReader.ReadFields(TypeDefinition type)
    31.    at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
    32.    at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
    33.    at Mono.Cecil.ImmediateModuleReader.ReadType(TypeDefinition type)
    34.    at Mono.Cecil.ImmediateModuleReader.ReadTypes(Collection`1 types)
    35.    at Mono.Cecil.ImmediateModuleReader.ReadModule(ModuleDefinition module, Boolean resolve_attributes)
    36.    at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action`2 read)
    37.    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
    38.    at Unity.Jobs.CodeGen.JobsILPostProcessor.AssemblyDefinitionFor(ICompiledAssembly compiledAssembly)
    39.    at Unity.Jobs.CodeGen.JobsILPostProcessor.Process(ICompiledAssembly compiledAssembly)
    40.    at Unity.ILPP.Runner.PostProcessingPipeline.PostProcessAssemblyAsync(PostProcessAssemblyRequest request, Action`2 progressSink)
    41.    at Unity.ILPP.Runner.PostProcessingService.PostProcessAssembly(PostProcessAssemblyRequest request, IServerStreamWriter`1 responseStream, ServerCallContext context)
    42. Unhandled Exception: System.InvalidOperationException: Post processing failed
    43.    at Unity.ILPP.Trigger.TriggerApp.<ProcessArgumentsAsync>d__1.MoveNext() + 0xf74
    44. --- End of stack trace from previous location ---
    45.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    46.    at Unity.ILPP.Trigger.TriggerApp.<ProcessArgumentsAsync>d__1.MoveNext() + 0x1149
    47. --- End of stack trace from previous location ---
    48.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    49.    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb6
    50.    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x42
    51.    at Unity.ILPP.Trigger.TriggerApp.<RunAsync>d__0.MoveNext() + 0xc7
    52. --- End of stack trace from previous location ---
    53.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    54.    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb6
    55.    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x42
    56.    at Program.<<Main>$>d__0.MoveNext() + 0x1a3
    57. --- End of stack trace from previous location ---
    58.    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
    59.    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb6
    60.    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x42
    61.    at Program.<Main>(String[]) + 0x20
    62.    at Unity.ILPP.Trigger!<BaseAddress>+0x47849b
    63.  
    Things I've done so far:
    * Made sure IL2CPP module is installed on this machine
    * Made sure both machines have the same .NET versions installed
    * Restarted the machine

    Any tips in tracking this down?
     
  2. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    114
    Update: this error showed up in both machines after all, but it didn't show up on the machine I thought was working until I tried to build the Addressables content to make a new build. (I'm guessing I must have had my Addressables Play Mode Script set to 'Use Existing Build' on the other machine where this error prevented playback, but I'll have to confirm later).

    So now I'm a bit stuck on this error before I can finish up the move to 2022.3 (I'm coming from 2020.3 and other than getting the Addressables content built, everything else has been migrated without issue), but it seems the stack trace isn't doing me any favors.
     
    Last edited: Aug 22, 2023
  3. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    114
    I've tracked the source of this error down to a pretty weird place after slowly commenting out all my systems one-by-one: it was a call to
    UnityEngine.Debug.LogWarning
    inside a SystemBase's OnUpdate method. The call was nested within two lambdas, but did NOT use any Job related stuff (at least it wasn't attempting to, no calls to Entities in there).