2016-08-13 3 views
0

次のWCFコードをPCLで問題なく実行するクロスプラットフォームフォームアプリケーションがありますが、iOSではTypeInitializationExceptionエラーが発生します。渡されるパラメータを見ると、queryDevicesパラメータは "System.TypeInitializationException:" System.Data.Services.Client.TypeSystem 'の型初期化子が例外をスローしました "として表示されます。iOSのWCF TypeInitializationExceptionエラー

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

初期化を有効にするにはどうすればよいですか?

+0

下記の回答を参照してください... –

答えて

0

適切なリンクを有効にするには、iOSプロジェクトのiOSビルドリンカーの動作をVSで「オフ」に設定する必要があるようです。