MSBuildWorkspace.Create on mono throws ReflectionTypeLoadExc



下面的工作在香草。net,但抛出一个反射typeloadeexception当我试图通过mono运行它:

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

异常:

 
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__Iterator12 2[System.Reflection.Assembly,System.Type]。MoveNext () [0x00000] in:0at System.Composition.TypedParts.TypedPartExportDescriptorProvider. tor (IEnumerable 1 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 (IEnumerable 1 assemblies) [0x00000] in:0在Microsoft.CodeAnalysis.Host.Mef.DesktopMefHostServices。get_DefaultServices () [0x00000] in:0at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create (dictionary ' 2 properties) [0x00000] in:0

这是已知的问题吗?

对我来说,手动添加所有Linq很有帮助。*项目库

最新更新