mardi 9 novembre 2021

Reference an old assembly with .NET Core

We're trying to migrate our WPF app to .NET 6.0 from .NET 4.6.1 and keep getting a MissingMethodException for DefineDynamicAssembly when calling into an old, obfuscated third-party library we currently depend on. The library appears to be built on .NET 3.5.

The closest-sounding thing we googled for was this SO post about System.Reflection.Emit, but we do not have the source code for the third-party library.

We are hoping there might be a way to finesse the library into working. Can anyone please offer insights?

Just to be clear, we don't care about deobfuscating the assembly. We just want it to work.

System.TypeInitializationException HResult=0x80131534 Message=The type initializer for 'A.c9a060eaf30c717bf2a2d42ef6a110a47' threw an exception. Source=assemblyName StackTrace: at A.c9a060eaf30c717bf2a2d42ef6a110a47.c8e61c0abc97221f783661115e77d8d32() at ThirdParty.Library.Repository.get_Default()

Inner Exception 1: TypeInitializationException: The type initializer for 'A.c11a752a126c751be2ef161586727cc33' threw an exception.

Inner Exception 2: MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.





Aucun commentaire:

Enregistrer un commentaire