[英]MonoTouch 4.2 does not support System.ServiceModel.EndpointAddress() when running on the device (works on the simulator)
I am using MonoTouch 4.2.1 with MonoDevelop 2.8 Beta 2 and XCode 4 . 我将MonoTouch 4.2.1与MonoDevelop 2.8 Beta 2和XCode 4一起使用 。 We are trying to call a .Net web service method through classes generated by the slsvcutil proxy generator.
我们正在尝试通过slsvcutil代理生成器生成的类调用.Net Web服务方法。
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. 在iPhone模拟器上测试该应用程序时,代码正在运行,我们成功连接到服务器并发送了Web服务请求。
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. 但是,在设备(带有iOS 4.3.5的iPhone 4)上测试应用程序时,在调用System.ServiceModel.EndpointAddress()构造函数时,该应用程序无法连接到服务器。
Note that it was working fine with MonoTouch 4.0.7. 请注意,它在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. 这似乎不是编译器问题,因为编译器选项应该是“仅链接SDK程序集”。 Someone know how to fix this crash or if is a new MonoTouch limitation/a bug in the last MonoTouch version?
有人知道如何解决此崩溃,或者在上一个MonoTouch版本中是否存在新的MonoTouch限制/错误?
Someone know how to fix this crash or if is a new MonoTouch limitation/a bug in the last MonoTouch version?
有人知道如何解决此崩溃,或者在上一个MonoTouch版本中是否存在新的MonoTouch限制/错误?
Have you tried the current version and/or contacted the support personal for MonoTouch? 您是否尝试过当前版本和/或联系了MonoTouch支持人员? Your only question seems like it would better directed at the support staff at MonoTouch and not here.
您唯一的问题似乎最好是针对MonoTouch的支持人员,而不是此处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.