Search code examples
xamarinxamarin.iosbreezebreeze-sharp

Breeze C# client fails when using WHERE clause on iOS Device


I am using the C# client for Breeze 0.6 in a Xamarin.Forms 2.0 app on iOS 9.3. When I do a query with an WHERE clause, the app will work in the iPhone simulator, but fails on the actual device. The failure on the device is an exception with the message:

The type initializer for 'System.Data.Services.Client.TypeSystem' threw an exception.

If I remove the where clause, the app no longer throws an exception, but I need to be able to use WHERE clauses to properly limit the amount of data being sent back from the server.

What is it that causes this error?


Solution

  • Woohoo! That helped. Thank you @hankide. There are three options for "Linker Behavior". They are "Don't Link", "Link Framework SDKs Only", and "Link All". The default was "Link Framework SDKs Only". I changed it to "Don't Link" and now it runs on my iPhone.

    Edited:

    Just an FYI for people seeing this. When you turn off the linker, you need to do it twice. Once for the Debug build configuration and another time for the Release build configuration. I was frustrated for a while because I couldn't get the release build to work. After setting up Xamarin Insights, I saw the same linker error I had seen before and figured out that there was a similar but separate linker config for the release build.