【问题标题】:WCF on iOS TypeInitializationException ErroriOS TypeInitializationException 错误上的 WCF
【发布时间】: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


【解决方案1】:

看来您需要在 VS 中将 iOS 项目的 iOS Build Linker Behavior 设置为“关闭”才能启用正确的链接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-28
    • 1970-01-01
    • 2011-04-11
    • 2012-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多