的MissingMethodException瓦特/单声道 [英] MissingMethodException w/ Mono

查看:169
本文介绍了的MissingMethodException瓦特/单声道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,通常情况下,在的MissingMethodException单意味着​​你要引用未在单声道实施框架的一部分,即使它是在Microsoft .NET框架提供。然而,在这种情况下,我接收到的MissingMethodException的的参照自己code进行方法。然而,这仅发生在单

由于异常不包含任何我的code,直到缺失的方法,我甚至不知道从哪里开始寻找这个问题。

下面是例外:

 未处理的异常:System.MissingMethodException:未找到方法:ParkingMapper.GeoHash.IndexGeoHash。
  在(包装管理到本机)System.Reflection.MonoMethodInfo:get_method_info(IntPtr的,System.Reflection.MonoMethodInfo和放大器;)
  在System.Reflection.MonoMethodInfo.GetMethodInfo(IntPtr的手柄)[0x00000]在C:\ cygwin的\ TMP \ monobuild \编译\ BUILD \单2.10.1 \ MCS \类\ corlib \ System.Reflect
离子\ MonoMethod.cs:63
  在System.Reflection.MonoMethod.GetPseudoCustomAttributes()[0x00002]在C:\ cygwin的\ TMP \ monobuild \编译\ BUILD \单2.10.1 \ MCS \类\ corlib \的System.Reflection \中号
onoMethod.cs:295
  在System.MonoCustomAttrs.GetPseudoCustomAttributes(ICustomAttributeProvider OBJ,System.Type的属性类型)0x0000d]在C:\ cygwin的\ TMP \ monobuild \建立\ BUILD
\单2.10.1 \ MCS \类\ corlib \ SYSTEM \ MonoCustomAttrs.cs:68
  在System.MonoCustomAttrs.IsDefined(ICustomAttributeProvider OBJ,System.Type的属性类型,布尔继承)[0x00039]在C:\ cygwin的\ TMP \ monobuild \建立\ BUIL
ð\单2.10.1 \ MCS \类\ corlib \ SYSTEM \ MonoCustomAttrs.cs:291
  在System.Reflection.MonoMethod.IsDefined(System.Type的属性类型,布尔继承)[0x00000]在C:\ cygwin的\ TMP \ monobuild \编译\ BUILD \单2.10.1 \ MCS \类\
corlib \的System.Reflection \ MonoMethod.cs:276
  在Microsoft.Internal.AttributeServices.IsAttributeDefined [ExportAttribute](ICustomAttributeProvider attributeProvider,布尔继承)[0x00000]中C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\Microsoft\Internal\AttributeServices.cs:40
  在System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsExport(ICustomAttributeProvider attributeProvider)[0x00000]中C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:355
  在System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo+<GetExportMembers>c__Iterator0.MoveNext ()[0x001b5]在C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:304
  在System.Linq.Enumerable.Any [的MemberInfo](IEnumerable`1源)[0x00024]在C:\ cygwin的\ TMP \ monobuild \编译\ BUILD \单2.10.1 \ MCS \类\ System.Core程序\系统。 LINQ的\ Enumerable.cs:136
  在System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.HasExports()[0x00000]在C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:106
  在System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsPartDiscoverable()[0x0003a]在C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:95
  在System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable (System.Type的类型,ICompositionElement原点)[0x0000a]中C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs:19
  在System.ComponentModel.Composition.Hosting.TypeCatalog.get_PartsInternal()[0x00051]在C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\Hosting\TypeCatalog.cs:166
  在System.ComponentModel.Composition.Hosting.TypeCatalog.CreateIndex()[0x0000b]在C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\Hosting\TypeCatalog.cs:263
  在System.Lazy`1[System.Collections.Generic.IDictionary`2[System.String,System.Collections.Generic.List`1[System.ComponentModel.Composition.Primitives.ComposablePartDefinition]]].InitValue ()[0x0014f]在C:\ cygwin的\ TMP \ monobuild \编译\ BUILD \单2.10.1 \ MCS \类\ corlib \ SYSTEM \ Lazy.cs:155
 

解决方案

明白了!看来MEF的单不喜欢DirectoryCatalog引用的DLL,没有出口。我指着当前组件目录,这是一个禁忌的单声道。

I am aware that typically, MissingMethodException in Mono means that you are referencing a part of the framework that isn't implemented in Mono, even though it is available in the Microsoft .NET framework. However, in this case, I am receiving a MissingMethodException only referring to a method in my own code. However, it only occurs on Mono.

Since the exception doesn't contain any of my code until the missing method, I'm not even sure where to begin to look for the issue.

Here is the exception:

Unhandled Exception: System.MissingMethodException: Method not found: 'ParkingMapper.GeoHash.IndexGeoHash'.
  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
  at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\corlib\System.Reflect
ion\MonoMethod.cs:63
  at System.Reflection.MonoMethod.GetPseudoCustomAttributes () [0x00002] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\corlib\System.Reflection\M
onoMethod.cs:295
  at System.MonoCustomAttrs.GetPseudoCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType) [0x0000d] in C:\cygwin\tmp\monobuild\build\BUILD
\mono-2.10.1\mcs\class\corlib\System\MonoCustomAttrs.cs:68
  at System.MonoCustomAttrs.IsDefined (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00039] in C:\cygwin\tmp\monobuild\build\BUIL
D\mono-2.10.1\mcs\class\corlib\System\MonoCustomAttrs.cs:291
  at System.Reflection.MonoMethod.IsDefined (System.Type attributeType, Boolean inherit) [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\
corlib\System.Reflection\MonoMethod.cs:276
  at Microsoft.Internal.AttributeServices.IsAttributeDefined[ExportAttribute] (ICustomAttributeProvider attributeProvider, Boolean inherit) [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\Microsoft\Internal\AttributeServices.cs:40
  at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsExport (ICustomAttributeProvider attributeProvider) [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:355
  at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo+<GetExportMembers>c__Iterator0.MoveNext () [0x001b5] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:304
  at System.Linq.Enumerable.Any[MemberInfo] (IEnumerable`1 source) [0x00024] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.Core\System.Linq\Enumerable.cs:136
  at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.HasExports () [0x00000] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:106
  at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsPartDiscoverable () [0x0003a] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs:95
  at System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable (System.Type type, ICompositionElement origin) [0x0000a] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs:19
  at System.ComponentModel.Composition.Hosting.TypeCatalog.get_PartsInternal () [0x00051] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\Hosting\TypeCatalog.cs:166
  at System.ComponentModel.Composition.Hosting.TypeCatalog.CreateIndex () [0x0000b] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\System.ComponentModel.Composition\src\ComponentModel\System\ComponentModel\Composition\Hosting\TypeCatalog.cs:263
  at System.Lazy`1[System.Collections.Generic.IDictionary`2[System.String,System.Collections.Generic.List`1[System.ComponentModel.Composition.Primitives.ComposablePartDefinition]]].InitValue () [0x0014f] in C:\cygwin\tmp\monobuild\build\BUILD\mono-2.10.1\mcs\class\corlib\System\Lazy.cs:155

解决方案

Got it! It seems MEF in Mono doesn't like a DirectoryCatalog that references DLLs with no exports. I was pointing at the current assembly directory, which is a no-no in Mono.

这篇关于的MissingMethodException瓦特/单声道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆