-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeLoadException due to BLOCK_REGION_UNION #55
Comments
Hm. The reason it shows up is probably because I'm using MEF in this project, which scans over all referenced assemblies and their types, forcing them to be loaded. |
Happens both with 2.3.9 and 2.3.10. |
I applied and posted a fix just now that should resolve this issue. If you can build, please test. Otherwise, I'll include in my next release. |
I think a simple test case would be something along these lines: using System;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
class Program
{
static void Main()
{
foreach (var file in Directory.EnumerateFiles(".", "Vanara*.dll"))
foreach (var type in Assembly.LoadFrom(file).DefinedTypes)
RuntimeHelpers.RunClassConstructor(type.TypeHandle);
}
} Place all the Vanara assemblies next to this program and it'll load all of them and force all types (nested or otherwise) in them to be initialized, which will result in exception(s) if any of them have invalid layout. |
Fixed and released today in 2.3.11 |
Describe the bug
What code is involved
No code, simply referencing several of the Vanara assemblies seems to trigger it. Not exactly sure which, but my project is referencing these:
(And all dependencies of these.)
Expected behavior
No TLE.
The text was updated successfully, but these errors were encountered: