Note that there are some explanatory texts on larger screens.

plurals
  1. POAOT Compile error when trying to serialize custom object using ServiceStack on Monotouch
    primarykey
    data
    text
    <p>I'm trying to serialize an object using servicestack in monotouch and I can't for the life of me figure out how to get the classes to be available when doing an AOT build for the device. The build works fine for the simulator. I have the latest version of Monotouch, and latest version of the Monotouch ServiceStack library, which I pulled and built myself this morning.</p> <p>What I'm trying to do is call the generic ToJson() to serialize model object (called Note below) of mine. All of my web service models / service calls / serialization / deserialization happen inside of a class library external to my iphone and android app, in which I am trying to call the JsConfig.RegisterForAot() and JsConfig.RegisterTypeForAot(), which seems to not help. I'm also calling those methods inside my iphone app since I'm unsure if both locations are necessary.</p> <p>Error/Stack trace:</p> <pre><code>Attempting to JIT compile method 'ServiceStack.Text.Common.WriteListsOfElements`2&lt;int, ServiceStack.Text.Json.JsonTypeSerializer&gt;:WriteListValueType (System.IO.TextWriter,object)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information. at ServiceStack.Text.Common.WriteType`2[MyClassLibrary.Note,ServiceStack.Text.Json.JsonTypeSerializer].WriteProperties (System.IO.TextWriter writer, System.Object value) [0x00000] in &lt;filename unknown&gt;:0 at ServiceStack.Text.JsonSerializer.SerializeToString (System.Object value, System.Type type) [0x00000] in &lt;filename unknown&gt;:0 at ServiceStack.Text.JsonSerializer.SerializeToString[Object] (System.Object value) [0x00000] in &lt;filename unknown&gt;:0 at ServiceStack.Text.StringExtensions.ToJson[Object] (System.Object obj) [0x00000] in &lt;filename unknown&gt;:0 at MyClassLibrary.Utils.ObjectToJson (System.Object obj) [0x00000] in &lt;filename unknown&gt;:0 at MyClassLibrary.Utils.AddObjectToData (System.Net.WebRequest request, System.Object obj) [0x00000] in &lt;filename unknown&gt;:0 at MyClassLibrary.Utils.SendJsonRequest[Note] (System.String url, System.String httpVerb, MyClassLibrary.Note obj) [0x00000] in &lt;filename unknown&gt;:0 at MyClassLibrary.Note.JSONSave () [0x00000] in &lt;filename unknown&gt;:0 at iphoneapp.myViewController.SaveNote () [0x000a5] in /Users/myUser/Projects/iphoneapp/iphoneapp/ViewControllers/myViewController.cs:83 Exact target/types: ServiceStack.Text.Common.WriteType`2[[MyClassLibrary.Note, MyClassLibraryName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[ServiceStack.Text.Json.JsonTypeSerializer, ServiceStack.Text.MonoTouch, Version=3.8.5.0, Culture=neutral, PublicKeyToken=null]] </code></pre> <p>Any help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload