【问题标题】:Webservice access error from monotouch (iphone debugging)来自 monotouch 的 Web 服务访问错误(iphone 调试)
【发布时间】:2009-12-22 13:38:49
【问题描述】:

具有 web 服务 (C#) 访问权限的应用程序在 MAC 上运行良好(iphone 模拟器),但 在 iphone 上不运行(发布和调试模式)。 当我尝试创建一个新的 web 服务实例时会发生这种情况。

        "YNSMS.ynSMSws.Service1 wsSMS = new YNSMS.ynSMSws.Service1();" 

这可能是 Monotouch iphone 运行时错误吗? 有什么办法解决吗?

加载的程序集:/private/var/mobile/Applications/47D2DA1C-28BA-43C8-BCF0-919D307C60EB/YNSMS.app/monotouch.dll 加载程序集:/private/var/mobile/Applications/47D2DA1C-28BA-43C8-BCF0-919D307C60EB/YNSMS.app/Mono.Security.dll 加载程序集:/private/var/mobile/Applications/47D2DA1C-28BA-43C8-BCF0-919D307C60EB/YNSMS.app/System.dll 加载程序集:/private/var/mobile/Applications/47D2DA1C-28BA-43C8-BCF0-919D307C60EB/YNSMS.app/System.Xml.dll 加载程序集:/private/var/mobile/Applications/47D2DA1C-28BA-43C8-BCF0-919D307C60EB/YNSMS.app/System.Web.Services.dll 加载程序集:/private/var/mobile/Applications/47D2DA1C-28BA-43C8-BCF0-919D307C60EB/YNSMS.app/AddressBookExample.exe 话题开始: 将“MainView.xib.cs:70”处的挂起断点解析为 Void AddressBookExample.MainView:ExecutaBotao ():0。 * ../../../../mono/metadata/marshal.c:4115 处的断言,未满足条件“方法” 堆栈跟踪:

at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool) 在 System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider,System.Type) 在 System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider,bool) 在 System.Reflection.MonoField.GetCustomAttributes (bool) 在 System.Xml.Serialization.XmlAttributes..ctor (System.Reflection.ICustomAttributeProvider) 在 System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers (System.Type) 在 System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlRootAttribute,string) 在 System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlRootAttribute,string) 在 System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type,System.Xml.Serialization.XmlRootAttribute,string) 在 System.Xml.Serialization.XmlReflectionImporter.ImportListMapping (System.Xml.Serialization.TypeData,System.Xml.Serialization.XmlRootAttribute,string,System.Xml.Serialization.XmlAttributes,int) 在 System.Xml.Serialization.XmlReflectionImporter.ImportListMapping (System.Type,System.Xml.Serialization.XmlRootAttribute,string,System.Xml.Serialization.XmlAttributes,int) 在 System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type,System.Xml.Serialization.XmlReflectionMember,string) 在 System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (string,string,System.Xml.Serialization.XmlReflectionMember[],bool,bool,bool,System.Xml.Serialization.XmlMappingAccess) 在 System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (string,string,System.Xml.Serialization.XmlReflectionMember[],bool,bool,bool) 在 System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (string,string,System.Xml.Serialization.XmlReflectionMember[],bool,bool) 在 System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping (string,string,System.Xml.Serialization.XmlReflectionMember[],bool) 在 System.Web.Services.Protocols.SoapMethodStubInfo..ctor (System.Web.Services.Protocols.TypeStubInfo,System.Web.Services.Protocols.LogicalMethodInfo,object,System.Xml.Serialization.XmlReflectionImporter,System.Xml.Serialization。 SoapReflectionImporter) 在 System.Web.Services.Protocols.SoapTypeStubInfo.CreateMethodStubInfo (System.Web.Services.Protocols.TypeStubInfo,System.Web.Services.Protocols.LogicalMethodInfo,bool) 在 System.Web.Services.Protocols.TypeStubInfo.BuildTypeMethods () 在 System.Web.Services.Protocols.TypeStubInfo.Initialize () 在 System.Web.Services.Protocols.LogicalTypeInfo.GetTypeStub(字符串) 在 System.Web.Services.Protocols.TypeStubManager.GetTypeStub (System.Type,string) 在 System.Web.Services.Protocols.SoapHttpClientProtocol..ctor () 在 YNSMS.ynSMSws.Service1..ctor () 在 AddressBookExample.MainView.ExecutaBotao (object,System.EventArgs) [0x00000] 在 /Volumes/STORAGE/cafexpto/Marcelo/sistemas_mac/MonoTouch/AddresBook/AddressBookExample/MainView.xib.cs:70 在 MonoTouch.UIKit.UIBarButtonItem/Callback.Call (MonoTouch.Foundation.NSObject) 在(包装器运行时调用)object.runtime_invoke_dynamic(intptr,intptr,intptr,intptr) 在(包装器托管到本机)MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) 在 MonoTouch.UIKit.UIApplication.Main (string[],string,string) 在 MonoTouch.UIKit.UIApplication.Main (string[]) 在 /Volumes/STORAGE/cafexpto/Marcelo/sistemas_mac/MonoTouch/AddresBook/AddressBookExample/Main.cs:14 中的 AddressBookExample.Application.Main (string[]) [0x00000] at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr)

本机堆栈跟踪:

0   AddressBookExample                  0x0003ca58 mono_handle_native_sigsegv + 396
1   AddressBookExample                  0x0006c13c sigabrt_signal_handler + 124
2   libSystem.B.dylib                   0x31a2584b _sigtramp + 42
3   libSystem.B.dylib                   0x31a279a3 kill + 10
4   libSystem.B.dylib                   0x31a27995 raise + 16
5   libSystem.B.dylib                   0x31a3c641 abort + 40
6   AddressBookExample                  0x001b0a0c g_logv + 248
7   AddressBookExample                  0x001b0a64 g_log + 52
8   AddressBookExample                  0x000e5a5c mono_marshal_get_runtime_invoke + 108
9   AddressBookExample                  0x0000b41c mono_jit_runtime_invoke + 624
10  AddressBookExample                  0x0011f054 mono_property_set_value + 68
11  AddressBookExample                  0x001453e4 create_custom_attr + 1212
12  AddressBookExample                  0x0014610c mono_custom_attrs_construct + 408
13  AddressBookExample                  0x001479a0 mono_reflection_get_custom_attrs_by_type + 92
14  AddressBookExample                  0x000c82bc custom_attrs_get_by_type + 80
15  AddressBookExample                  0x004e8fd4 wrapper_managed_to_native_System_MonoCustomAttrs_GetCustomAttributesInternal_System_Reflection_ICustomAttributeProvider_System_Type_bool + 80

* 断言:不应在 ../../../../mono/mini/mini-darwin.c:258 到达

【问题讨论】:

  • 你应该把它发送到 monotouch 的邮件列表,他们的开发人员可以在那里查看:lists.ximian.com/mailman/listinfo/monotouch
  • 这是尝试使用 MonoTouch 之类的东西编写 iPhone 应用程序的问题......在您实际编写的内容之上有太多额外的层,问题可能出在任何地方。它可能在你的代码中,它可能在 MonoTouch API 中,它可能与工具链、将你写下的代码编译成原生 iPhone 代码的过程有关……结果是一个隐藏的问题在这一切之下......祝你好运......

标签: iphone web-services xamarin.ios deployment


【解决方案1】:

我的猜测是这与 MonoTouch 链接器删除一些 XML 字段有关 - 尝试将 Preserve(AllMembers=true) 属性添加到生成的 Web 服务代码。

【讨论】:

    猜你喜欢
    • 2012-12-05
    • 2010-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-20
    相关资源
    最近更新 更多