2011-03-26 41 views
2

我知道,通常,Mono中的MissingMethodException意味着您引用的是在Mono中未实现的框架的一部分,即使它在Microsoft .NET框架中可用。但是,在这种情况下,我收到MissingMethodException 只有指的是我自己的代码中的方法。但是,它只发生在Mono上。MissingMethodException w/Mono

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

这里是个例外:

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 

回答

3

明白了!看起来Mono中的MEF不喜欢一个DirectoryCatalog,它引用的DLL没有导出。我指着当前的汇编目录,这在Mono中是不可能的。

+2

嗨,如果这种情况只发生在单声道上,如果你可以通过repro提交一个bug,这将非常有帮助。谢谢! – 2011-03-26 14:16:29

+0

@Jb Evain当然,没问题! – 2011-03-26 14:36:02

+0

在移动到Mono.Addins之前,我们也遇到了这个问题。 DirectoyCatalog很好地指向MS.NET下的bin目录,但在Mono下失败。 – 2011-03-28 02:05:24

相关问题