MonoTouch 4.2 在设备上运行时不支持 System.ServiceModel.EndpointAddress()(在模拟器上工作)
我正在使用 MonoTouch 4.2.1 以及 MonoDevelop 2.8 Beta 2 和 XCode 4。我们尝试通过 slsvcutil 代理生成器生成的类来调用 .Net Web 服务方法。
在 iPhone 模拟器上测试应用程序时,代码正在运行,我们成功连接到服务器并发送 Web 服务请求。
但是,在设备(带有 iOS 4.3.5 的 iPhone 4)上测试应用程序时,应用程序在调用 System.ServiceModel.EndpointAddress() 构造函数时无法连接到服务器。
请注意,它在 MonoTouch 4.0.7 上运行良好。
我们收到错误:
Attempting to JIT compile method 'System.Linq.Enumerable:FirstOrDefault<System.ServiceModel.Description.OperationDescription> (System.Collections.Generic.IEnumerable`1<System.ServiceModel.Description.OperationDescription>,System.Func`2<System.ServiceModel.Description.OperationDescription, bool>)' while running with --aot-only.
以下行似乎崩溃了:
new System.ServiceModel.EndpointAddress(
string.Format(System.Globalization.CultureInfo.InvariantCulture, "http://{0}:{1}/Dartfish/RemoteControlServices/",
address, port)));
错误堆栈: >
[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: Attempting to JIT compile method
'System.Linq.Enumerable:FirstOrDefault<System.ServiceModel.Description.OperationDescription> (System.Collections.Generic.IEnumerable`1<System.ServiceModel.Description.OperationDescription>,System.Func`2 System.ServiceModel.Description.OperationDescription, bool)' while running with --aot-only.
at System.ServiceModel.Description.ContractDescriptionGenerator.GetOrCreateOperation (System.ServiceModel.Description.ContractDescription cd, System.Reflection.MethodInfo mi, System.Reflection.MethodInfo serviceMethod, System.ServiceModel.OperationContractAttribute oca, System.Type asyncReturnType, Boolean isCallback, System.Type givenServiceType)
at System.ServiceModel.Description.ContractDescriptionGenerator.FillOperationsForInterface (System.ServiceModel.Description.ContractDescription cd, System.Type exactContractType, System.Type givenServiceType, Boolean isCallback)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContractInternal (System.Type givenContractType, System.Type givenServiceType, System.Type serviceTypeForCallback)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type givenContractType, System.Type givenServiceType, System.Type serviceTypeForCallback)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type givenContractType, System.Type givenServiceType)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type contractType)
at System.ServiceModel.Description.ContractDescription.GetContract (System.Type contractType)
at System.ServiceModel.ChannelFactory`1[ICommandMgr].CreateDescription ()
m.ServiceModel.ChannelFactory`1[ICommandMgr]..ctor (System.Type type)
at System.ServiceModel.ChannelFactory`1[ICommandMgr]..ctor (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at System.ServiceModel.ClientBase`1[ICommandMgr].Initialize (System.ServiceModel.InstanceContext instance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at System.ServiceModel.ClientBase`1[ICommandMgr]..ctor (System.ServiceModel.InstanceContext instance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at System.ServiceModel.ClientBase`1[ICommandMgr]..ctor (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at CommandMgrClient..ctor (System.ServiceModel.Channels.
at Dartfish.ViewModel.RemoteControlViewModel.ProxyTransportViewModel.DoCommandMgrOpenAsync (System.String address, Int32 port)
这似乎不是编译器问题,因为编译器选项应该是“仅链接 SDK 程序集”。 有人知道如何修复此崩溃,或者是否是新的 MonoTouch 限制/上一个 MonoTouch 版本中的错误?
I am using MonoTouch 4.2.1 with MonoDevelop 2.8 Beta 2 and XCode 4. We are trying to call a .Net web service method through classes generated by the slsvcutil proxy generator.
When testing the app on the iPhone simulator, the code is working and we succeed to connect to the server and send web services requests.
However, when testing the app on a device (iPhone 4 with iOS 4.3.5), the app fails to connect to the server when calling System.ServiceModel.EndpointAddress() constructor.
Note that it was working fine with MonoTouch 4.0.7.
we get the error:
Attempting to JIT compile method 'System.Linq.Enumerable:FirstOrDefault<System.ServiceModel.Description.OperationDescription> (System.Collections.Generic.IEnumerable`1<System.ServiceModel.Description.OperationDescription>,System.Func`2<System.ServiceModel.Description.OperationDescription, bool>)' while running with --aot-only.
It is the following line that seems to crash:
new System.ServiceModel.EndpointAddress(
string.Format(System.Globalization.CultureInfo.InvariantCulture, "http://{0}:{1}/Dartfish/RemoteControlServices/",
address, port)));
Error stack:
[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: Attempting to JIT compile method
'System.Linq.Enumerable:FirstOrDefault<System.ServiceModel.Description.OperationDescription> (System.Collections.Generic.IEnumerable`1<System.ServiceModel.Description.OperationDescription>,System.Func`2 System.ServiceModel.Description.OperationDescription, bool)' while running with --aot-only.
at System.ServiceModel.Description.ContractDescriptionGenerator.GetOrCreateOperation (System.ServiceModel.Description.ContractDescription cd, System.Reflection.MethodInfo mi, System.Reflection.MethodInfo serviceMethod, System.ServiceModel.OperationContractAttribute oca, System.Type asyncReturnType, Boolean isCallback, System.Type givenServiceType)
at System.ServiceModel.Description.ContractDescriptionGenerator.FillOperationsForInterface (System.ServiceModel.Description.ContractDescription cd, System.Type exactContractType, System.Type givenServiceType, Boolean isCallback)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContractInternal (System.Type givenContractType, System.Type givenServiceType, System.Type serviceTypeForCallback)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type givenContractType, System.Type givenServiceType, System.Type serviceTypeForCallback)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type givenContractType, System.Type givenServiceType)
at System.ServiceModel.Description.ContractDescriptionGenerator.GetContract (System.Type contractType)
at System.ServiceModel.Description.ContractDescription.GetContract (System.Type contractType)
at System.ServiceModel.ChannelFactory`1[ICommandMgr].CreateDescription ()
m.ServiceModel.ChannelFactory`1[ICommandMgr]..ctor (System.Type type)
at System.ServiceModel.ChannelFactory`1[ICommandMgr]..ctor (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at System.ServiceModel.ClientBase`1[ICommandMgr].Initialize (System.ServiceModel.InstanceContext instance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at System.ServiceModel.ClientBase`1[ICommandMgr]..ctor (System.ServiceModel.InstanceContext instance, System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at System.ServiceModel.ClientBase`1[ICommandMgr]..ctor (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress)
at CommandMgrClient..ctor (System.ServiceModel.Channels.
at Dartfish.ViewModel.RemoteControlViewModel.ProxyTransportViewModel.DoCommandMgrOpenAsync (System.String address, Int32 port)
It's don't seems to be a compiler issue since compiler option is "Link SDK assemblies only" as it should be. Someone know how to fix this crash or if is a new MonoTouch limitation/a bug in the last MonoTouch version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过当前版本和/或联系过 MonoTouch 的支持人员?您唯一的问题似乎最好是向 MonoTouch 的支持人员提出,而不是在这里。
Have you tried the current version and/or contacted the support personal for MonoTouch? Your only question seems like it would better directed at the support staff at MonoTouch and not here.