Skip to content

Extract all platform corlib profiles for 2021.2+ #3

@Albeoris

Description

@Albeoris

What happened?

I encountered the fact that DLLs in a game created on Unity 2022.3.30.f1 were stripped.
Because of this, the preloader crashed with the error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: void System.Reflection.Module.GetPEKind(System.Reflection.PortableExecutableKinds&,System.Reflection.ImageFileMachine&)
  at BepInEx.Preloader.PreloaderRunner.PreloaderPreMain () [0x00000] in <47f8536982f34f539e906b1b3b7c96a0>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <3dff697d7878442fa5427675adf00b31>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004b] in <3dff697d7878442fa5427675adf00b31>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <3dff697d7878442fa5427675adf00b31>:0 
  at Doorstop.Entrypoint.Start () [0x0008b] in <47f8536982f34f539e906b1b3b7c96a0>:0

I followed this guide and downloaded unstripped corlibs from the archive.

But the game starts crashing because of:

DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <f06813fea36f4d329c559563c08ea387>:0 
Rethrow as TypeInitializationException: The type initializer for 'Sys' threw an exception.
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <f06813fea36f4d329c559563c08ea387>:0 
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath) [0x00006] in <f06813fea36f4d329c559563c08ea387>:0 
  at System.IO.File.Exists (System.String path) [0x00043] in <f06813fea36f4d329c559563c08ea387>:0 
  at System.Console..cctor () [0x00000] in <f06813fea36f4d329c559563c08ea387>:0 
Rethrow as TypeInitializationException: The type initializer for 'System.Console' threw an exception.
  at UnityEngine.UnityLogWriter.Init () [0x00001] in C:\build\output\unity\unity\Runtime\Export\Logging\UnityLogWriter.bindings.cs:25 
  at UnityEngine.ClassLibraryInitializer.Init () [0x00001] in C:\build\output\unity\unity\Runtime\Export\Scripting\ClassLibraryInitializer.cs:20 

This is because the archive contains only one version of mscorlib.dll, but now it is platform-specific.

Correct Windows-specific libraries from Unity Editor:
2022.3.30_Win.zip

Could you upload DLLs for all platforms?

Steps to reproduce

  1. On Windows, in the game try use BepInEx.
  2. Download unstripped version of DLLs and compare it with correct Windows-version.

BepInEx Distribution

Stable from GitHub

Log outputs

No response

Environment

- OS: Windows 10
- BepInEx: 5.4.23.2
- Game: Bloomtown

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions