mardi 6 octobre 2015

MSBuildWorkspace.Create on mono throws ReflectionTypeLoadException

The following works on vanilla .NET but throws a ReflectionTypeLoadException when I try to run it through mono:

var props = new Dictionary<string, string>();
props["CheckForSystemRuntimeDependency"] = "true";
using (var msWorkspace = MSBuildWorkspace.Create(props))
{
   ...

Exception is:


System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (System.Reflection.Assembly,bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in :0
  at System.Reflection.Assembly+<>c__Iterator0.MoveNext () [0x00000] in :0
  at System.Linq.Enumerable+c__Iterator102[System.Reflection.TypeInfo,System.Type].MoveNext () [0x00000] in <filename unknown>:0
  at System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator122[System.Reflection.Assembly,System.Type].MoveNext () [0x00000] in :0
  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (IEnumerable1 types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00000] in <filename unknown>:0
  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00000] in <filename unknown>:0
  at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (IEnumerable1 assemblies) [0x00000] in :0
  at Microsoft.CodeAnalysis.Host.Mef.DesktopMefHostServices.get_DefaultServices () [0x00000] in :0
  at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create (IDictionary`2 properties) [0x00000] in :0


...

Is this a known problem?





Aucun commentaire:

Enregistrer un commentaire