3

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?

Brian
  • 1,675
  • 3
  • 19
  • 29
  • 1
    Are you using the linker? That could be the problem.. Try to disable the linker and run the app again with the where clause intact. – Timo Salomäki Jul 29 '16 at 21:16
  • I started to comment here, but then moved it down below so I could mark it as the answer. One question though. Is the linker required if I need to use external libraries? I have an external ObjC based library from a 3rd party that I eventually want to incorporate as well. Am I going to need the linker for that? – Brian Jul 30 '16 at 01:20

1 Answers1

1

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.

Brian
  • 1,675
  • 3
  • 19
  • 29