2011-09-26 68 views
1

我正在使用MonoTouch 4.2.1与MonoDevelop 2.8 Beta 2和XCode 4。我们正试图通过slsvcutil代理生成器生成的类调用.Net Web服务方法。MonoTouch 4.2不支持在设备上运行时的System.ServiceModel.EndpointAddress()(适用于模拟器)

在iPhone模拟器上测试应用程序时,代码正在工作,我们成功连接到服务器并发送Web服务请求。

但是,当在设备上测试应用程序(iPhone 4与iOS 4.3.5)时,应用程序在调用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) 

这是唐“T似乎是编译器问题,因为编译器选项应该是“仅链接SDK程序集”。 有人知道如何解决这个崩溃问题,或者是否有新的MonoTouch限制/最后一个MonoTouch版本中的错误?

+1

我不能用**“new System.ServiceModel.EndpointAddress(...)”**重复该问题。请填写http://bugzilla.xamarin.com上的错误报告,并包含一个小型自包含的测试用例来说明问题。谢谢 – poupou

+0

报告错误:http://bugzilla.xamarin.com/show_bug.cgi?id=1053 – Nicolas

+0

我试图再次重新安装MonoTouch 4.2.1,它现在工作正常。对不起,花时间! – Nicolas

回答

1

Someone know how to fix this crash or if is a new MonoTouch limitation/a bug in the last MonoTouch version?

您是否尝试过的当前版本和/或联系个人​​对MonoTouch的支持?你唯一的问题似乎是更好地指向MonoTouch的支持人员,而不是在这里。

+0

不,但MonoTouch支持网站建议使用Stackoverflow :-)。我会做的。 – Nicolas

相关问题