Start a new topic

Parsing a list of string gives "Don't know about System.Collections.Generic.List`1[System.String]" in C#

I have a data model in Kinvey store named "debug" that looks like below, 


  "id": 1719844608,
  "firstName": "Johnnie",
  "lastName": "Jonathan",
  "phones": {
    "home": "524-789-3468",
    "mobile": "691-772-7392"
  "email": [
  "dateOfBirth": "1999-05-19T00:00:00.000Z",
  "registered": true,
  "gender": "female",
  "photo": 41

Here, I have an array of string under key email.

When I try to get the model using FindAsync(); I get the following exception,  

Don't know about System.Collections.Generic.List`1[System.String]

 Here is my corresponding C# model class 


using System;
using System.Net;
using System.Collections.Generic;
using Kinvey;
using Newtonsoft.Json;
using SQLite.Net;
using SQLite.Net.Attributes;

namespace ABC
    public partial class DebugModel : Entity
        [JsonProperty("gender")] public string Gender { get; set; }
        [JsonProperty("email")] public List<string> Email { get; set; }
        [JsonProperty("dateOfBirth")] public string DateOfBirth { get; set; }
        [JsonProperty("firstName")] public string FirstName { get; set; }
        [JsonProperty("lastName")] public string LastName { get; set; }
        [JsonProperty("photo")] public long Photo { get; set; }
        [JsonProperty("phones")] public Phones Phones { get; set; }
        [JsonProperty("registered")] public bool Registered { get; set; }

        public DebugModel() {}

    public partial class Phones: ISerializable<string>
        [JsonProperty("home")] public string Home { get; set; }
        [JsonProperty("mobile")] public string Mobile { get; set; }

        public Phones() { }

        public string Serialize()
            return JsonConvert.SerializeObject(this);

 This is how I am getting the data from Kinvey store, 


private async void GetData()
    DataStore<DebugModel> dataStore = DataStore<DebugModel>.Collection("debug");
    List<DebugModel> debugs = new List<DebugModel>();
    debugs = await dataStore.FindAsync();
    foreach (DebugModel d in debugs)
        Debug.WriteLine("Tag: " + d);

 Please reply how to resolve this issue? Any help is appreciated. 

Thanks in advance! 


I am looking into this. Could you please answer following questions

  • Which version of the Xamarin sdk are you using?
  • On which line of code are you getting this exception? or is it in the response of FindAsync()?
  • Could you please try this with keeping only 'email' in the DebugModel class? That way we can verify if it is what is causing the problem.

Please get back to us with the answers.


Hello Abhijeet, 

Thanks for your reply. Here are the answers, 

1. Using Xamarin.Forms (, Kinvey (3.0.17)

2. Getting the exception in this line, 


DataStore<DebugModel> dataStore = DataStore<DebugModel>.Collection("debug");

Here is the full stacktrace, 


System.NotSupportedException: Don't know about System.Collections.Generic.List`1[System.String]
  at SQLite.Net.Orm.SqlType (SQLite.Net.TableMapping+Column p, System.Boolean storeDateTimeAsTicks, SQLite.Net.IBlobSerializer serializer, System.Collections.Generic.IDictionary`2[TKey,TValue] extraTypeMappings) [0x002e4] in <8f2bb39aeff94a30a8628064be9c7efe>:0
  at SQLite.Net.Orm.SqlDecl (SQLite.Net.TableMapping+Column p, System.Boolean storeDateTimeAsTicks, SQLite.Net.IBlobSerializer serializer, System.Collections.Generic.IDictionary`2[TKey,TValue] extraTypeMappings) [0x00016] in <8f2bb39aeff94a30a8628064be9c7efe>:0
  at SQLite.Net.SQLiteConnection.<CreateTable>b__66_0 (SQLite.Net.TableMapping+Column p) [0x00013] in <8f2bb39aeff94a30a8628064be9c7efe>:0
  at System.Linq.Enumerable+SelectArrayIterator`2[TSource,TResult].ToArray () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/
  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/
  at SQLite.Net.SQLiteConnection.CreateTable (System.Type ty, SQLite.Net.Interop.CreateFlags createFlags) [0x0004c] in <8f2bb39aeff94a30a8628064be9c7efe>:0
  at SQLite.Net.SQLiteConnection.CreateTable[T] (SQLite.Net.Interop.CreateFlags createFlags) [0x00000] in <8f2bb39aeff94a30a8628064be9c7efe>:0
  at Kinvey.SQLiteCache`1[T].createTable () [0x00000] in <fe5ad8ee3e1044829806fc93302a4933>:0
  at Kinvey.SQLiteCache`1[T]..ctor (System.String collection, SQLite.Net.Async.SQLiteAsyncConnection connectionAsync, SQLite.Net.SQLiteConnection connectionSync, SQLite.Net.Interop.ISQLitePlatform platform) [0x0001c] in <fe5ad8ee3e1044829806fc93302a4933>:0
  at Kinvey.SQLiteCacheManager.GetCache[T] (System.String collectionName) [0x00083] in <fe5ad8ee3e1044829806fc93302a4933>:0
  at Kinvey.DataStore`1[T]..ctor (Kinvey.DataStoreType type, System.String collectionName, Kinvey.AbstractClient client) [0x00069] in <fe5ad8ee3e1044829806fc93302a4933>:0
  at Kinvey.DataStore`1[T].Collection (System.String collectionName, Kinvey.AbstractClient client) [0x00000] in <fe5ad8ee3e1044829806fc93302a4933>:0
  at Vromon.Views.HomePage+<GetData>d__4.MoveNext () [0x00018] in /Users/shahab/Documents/Work/Playground/vromon/Vromon/Views/HomePage.xaml.cs:73
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/Foundation/NSAction.cs:163
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/UIKit/UIApplication.cs:63
  at Vromon.iOS.Application.Main (System.String[] args) [0x00001] in /Users/shahab/Documents/Work/Playground/vromon/iOS/Main.cs:17


However, if I comment out the line, 


// [JsonProperty("email")] public List<string> Email { get; set; }

all works perfectly.


3. Removed all other properties but Email, got the same exception.  

Hi Shahab,

It will really help us if you could please share your project with us. If you are not comfortable with sharing it here you can email it to me( I will continue looking into this.


Hello Abhijeet, 

I have sent you an email with the project attached. Please let me know if you need any details. 

Thank you. 

Hello Abhijeet, 

I think you have missed the email. I am uploading the project here. Please take a look. 

Thank you. 

(68.7 KB)
Login or Signup to post a comment