WCF on iOS TypeInitializationException Error
NickName:Marc George Ask DateTime:2016-08-14T04:20:31

WCF on iOS TypeInitializationException Error

I have a cross-platform forms app which runs the following WCF code in the PCL without issue, but on iOS it throws a TypeInitializationException error. Looking at the parameters being passed in, the queryDevices parameter is shown as "System.TypeInitializationException: The type initializer for 'System.Data.Services.Client.TypeSystem' threw 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);
    }

How do I enable the initialization?

Copyright Notice:Content Author:「Marc George」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38936660/wcf-on-ios-typeinitializationexception-error

More about “WCF on iOS TypeInitializationException Error” related questions

WCF on iOS TypeInitializationException Error

I have a cross-platform forms app which runs the following WCF code in the PCL without issue, but on iOS it throws a TypeInitializationException error. Looking at the parameters being passed in, the

Show Detail

Xamarin iOS throws System.TypeInitializationException when loading a large native library

I have an iOS app built with Xamarin iOS that crashes when loading the class that has DllImport attributes for PInvoke calls. The exception is: Unhandled managed exception: An exception was thrown...

Show Detail

IOS calling WCF service

I am trying to call a WCF service from IOS Xcode. I am generating the code from WSDL using SuDz-C. The code is successfully generated as far as the Exposed classes and methods are concerned. But, the

Show Detail

WCF to iOS web method

I am developing an app on xamarin.ios. We have a WCF service that is not hosted by IIS. When I want to add this service as reference, Http 405 occurs. But when I create a WCF service which is hos...

Show Detail

TypeInitializationException was unhandled

I'm using opennlp tool in C# language. I wrote the following code: string modelpath = @"D:\models\en-sent.bin"; java.io.FileInputStream modelInpStream = new java.io.FileInputStream(modelpath);

Show Detail

Create Restful WCF for iOS

The iOS code, which is consuming my WCF is: #import "ViewController.h" //#import "AFNetworking.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad {&

Show Detail

TypeInitializationException in PostSharp

I have added PostSharp (4.0.37) and PostSharp.Patterns.Model to my project. It then compiles and runs fine. I then add the [NotifyPropertyChanged] to my very simple scaled-down example class (cont...

Show Detail

Unit testing TypeInitializationException error

I am working on a unit testing for a function in a form call Tester.cs, below is the error: Error 7/31/2012 10:43:11 PM One of the background threads threw exception: System.

Show Detail

WCF MSMQ DllNotFoundException

I am trying to access a remote WCF service (using netMsmqBinding) hosted in a windows service and am getting the error: Message: System.TypeInitializationException: The type initializer for 'System.

Show Detail

Error System.TypeInitializationException while debugging

I got following error when I process the code that I got from my friend, would you think it is an environment setup problem? Error message appears at: com.lowagie.text.pdf.PdfWriter.getInstance(Do...

Show Detail