Skip to content

Commit fb1f637

Browse files
committed
Workaround System.TypeLoad exception when running test-suite on macOS.
It was reproducible while running Compile.sh on macOS: mono64 --debug "../lib/Release_x64/Encodings.Gen.exe" Generating bindings for Encodings (CSharp) Looking for tests in: /Users/joao/Dev/CppSharp/tests/Encodings Parsed 'Encodings.h' Unhandled Exception: System.TypeLoadException: Could not load type of field 'CppSharp.MSVCToolchain:<>f__am$cache7' (8) due to: Could not load file or assembly 'Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
1 parent 0b9b10d commit fb1f637

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Generator/Utils/Utils.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ public static class AssemblyHelpers
111111
public static IEnumerable<Type> FindDerivedTypes(this Assembly assembly,
112112
Type baseType)
113113
{
114-
return assembly.GetTypes().Where(baseType.IsAssignableFrom);
114+
return assembly.GetTypes()
115+
.Where(type => !type.FullName.Contains("CppSharp.MSVCToolchain"))
116+
.Where(baseType.IsAssignableFrom);
115117
}
116118
}
117119

0 commit comments

Comments
 (0)