question

DavidBLT-6335 avatar image
0 Votes"
DavidBLT-6335 asked HuiLiu-MSFT commented

Using third-party library in .NET 6.0

We're trying to migrate our WPF app to .NET 6.0 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 a Stack Overflow post (link) 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)'.


windows-wpf
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,@DavidBLT-6335. Coul you display the name and link of the third-party library you use?How did you add third-party libraries to your project? Can you try to delete the old version and install the latest version of the third-party software package?

0 Votes 0 ·

0 Answers