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