Access Violation from R2R (ready-to-run) assembly when using GetTypes() from a thread in Net Core (Net7)

56 Views Asked by At

I am in a thread where I am using

AssemblyLoadContext.Default.Assemblies

to retrieve the loaded assemblies and call GetTypes() on them.

In the list of assemblies there is also PresentationFramework which turns to be a ready-to-run (R2R) assembly. When calling GetTypes() or even inspecting the assembly instance in the Watch or Immediate Window, I get an access violation.

Is it there a way to properly deal with R2R assemblies and make sure I can get the types or skip the file altogether?

0

There are 0 best solutions below