Hello,
After an unity update my project can properly run on editor but can’t compile on PC/android.
The same error occured all the time :
BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
Mono.Cecil.PE.ImageReader.ReadImage ()
Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream)
Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters)
Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters)
Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName)
Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName)
UnityEditor.AssemblyHelper.ExtractInternalAssemblyName (System.String path) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:65)
UnityEditor.AssemblyHelper.CheckForAssemblyFileNameMismatch (System.String assemblyPath) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:20)
UnityEditor.HostView:OnGUI()
Error building Player: BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
I tried to reimport all plugins and reboot unity.
If I reimport the project in 5.6.0, it’s working. If the error comes from a dll, how can I find it ?
Thank you
If the same project works in 5.6.0, but stops working in 5.6.5, then it sounds like you found a regression. In this case, Unity Technologies would probably be thankful if you submit a bug-report, following the advice given in this document , so they can fix the issue.