简体   繁体   English

在设备上运行时,MonoTouch 4.2不支持System.ServiceModel.EndpointAddress()(在模拟器上运行)

[英]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.

相关问题 在设备上运行时,MonoTouch不支持OpenAsync方法打开Web服务连接(在模拟器上工作) - MonoTouch does not support OpenAsync method for opening a web service connection when running on the device (works on the simulator) Monotouch应用程序在设备中崩溃,但在模拟器中工作正常 - Monotouch application is getting crashed in device but works fine in simulator MonoTouch应用程序在Simulator中运行,但不在Device上运行 - MonoTouch application runs in Simulator, but not on Device MonoTouch iOS应用程序无法在设备目录中找到文件-在模拟器上工作 - MonoTouch iOS application can't find files in directory on device - works on simulator MonoTouch运行时测试,看它是否在模拟器中运行 - MonoTouch runtime test to see if it's running in the simulator MonoTouch还支持NSInvocationOperation吗? - Does MonoTouch support NSInvocationOperation yet? Xamarin.ios 不适用于真正的 iOS 设备,但它适用于模拟器 - Xamarin.ios does NOT work on real iOS device but it works on Simulator 命名空间“System”中不存在“ServiceModel”。 当我尝试添加引用时,它说它已被引用 - 'ServiceModel' does not exist in namespace 'System'. When I try to add a reference, it says it's already referenced MonoTouch - System.ServiceModel.Dispatcher.ClientOperation失败(“无法加载[type]的签名)。 - MonoTouch - System.ServiceModel.Dispatcher.ClientOperation fails ("Could not Load signature of [type]). GetViewForHeader可在模拟器中工作,但不能在设备上工作 - GetViewForHeader works in the simulator but not working on the device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM