【发布时间】:2016-08-13 20:20:31
【问题描述】:
我有一个跨平台表单应用程序,它在 PCL 中运行以下 WCF 代码没有问题,但在 iOS 上它会引发 TypeInitializationException 错误。查看传入的参数,queryDevices 参数显示为“System.TypeInitializationException: The type initializer for 'System.Data.Services.Client.TypeSystem' throw an exception.”
IR_context = new IdentityServices.identityrelationships_dbEntities(svcUri);
DataServiceQuery<IdentityServices.Device> queryDevices = (DataServiceQuery<IdentityServices.Device>)(from device in IR_context.Devices where device.MAC == DeviceID select device);
try
{
// Begin query execution, supplying a method to handle the response
// and the original query object to maintain state in the callback.
queryDevices.BeginExecute(OnDeviceQueryComplete, queryDevices);
}
如何启用初始化?
【问题讨论】:
-
见下面的答案...
标签: wcf xamarin.ios xamarin.forms wcf-data-services