Browse Source

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.
pull/1267/head
Joao Matos 6 years ago
parent
commit
fb1f637ec3
  1. 4
      src/Generator/Utils/Utils.cs

4
src/Generator/Utils/Utils.cs

@ -111,7 +111,9 @@ namespace CppSharp @@ -111,7 +111,9 @@ namespace CppSharp
public static IEnumerable<Type> FindDerivedTypes(this Assembly assembly,
Type baseType)
{
return assembly.GetTypes().Where(baseType.IsAssignableFrom);
return assembly.GetTypes()
.Where(type => !type.FullName.Contains("CppSharp.MSVCToolchain"))
.Where(baseType.IsAssignableFrom);
}
}

Loading…
Cancel
Save