iOS上的WCF TypeInitializationException错误

时间:2016-08-13 20:20:31

标签: wcf xamarin.ios xamarin.forms wcf-data-services

我有一个跨平台的表单应用程序,在PCL中运行以下WCF代码没有问题,但在iOS上它会抛出TypeInitializationException错误。查看传入的参数,queryDevices参数显示为" System.TypeInitializationException:System.Data.Services.Client.TypeSystem' System.Data.Services.Client.TypeSystem'的类型初始值设定项。抛出异常。"

    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);
    }

如何启用初始化?

1 个答案:

答案 0 :(得分:0)

您似乎需要在VS中将iOS项目的iOS Build Linker行为设置为“Off”以启用正确的链接。