gpt4 book ai didi

c# - MissingMethodException w/Mono

转载 作者:行者123 更新时间:2023-11-30 22:39:57 27 4
gpt4 key购买 nike

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

由于在缺少方法之前异常不包含我的任何代码,所以我什至不确定从哪里开始寻找问题。

异常(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

最佳答案

明白了!似乎 Mono 中的 MEF 不喜欢引用没有导出的 DLL 的 DirectoryCatalog。我指的是当前程序集目录,这在 Mono 中是禁忌。

关于c# - MissingMethodException w/Mono,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5442812/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com