rpgmaker / NetJSON

Faster than Any Binary? Benchmark: http://theburningmonk.com/2014/08/json-serializers-benchmarks-updated-2/
MIT License
230 stars 29 forks source link

Getting Exception when serializing #225

Closed mbacic1 closed 3 years ago

mbacic1 commented 4 years ago

{System.ArgumentNullException: Value cannot be null. Parameter name: meth at System.Reflection.Emit.ILGenerator.Emit (System.Reflection.Emit.OpCode opcode, System.Reflection.MethodInfo meth) [0x00009] in <46c2fa109b574c7ea6739f9fe2350976>:0 at NetJSON.NetJSON+<>c__DisplayClass334_0.<Serialize>b__0 (System.Type _) [0x000fa] in <e389d4d78c47488f869318e66a15c008>:0 at System.Collections.Concurrent.ConcurrentDictionary2[TKey,TValue].GetOrAdd (TKey key, System.Func2[T,TResult] valueFactory) [0x00034] in <46c2fa109b574c7ea6739f9fe2350976>:0 at NetJSON.NetJSON.Serialize (System.Type type, System.Object value) [0x0000d] in <e389d4d78c47488f869318e66a15c008>:0 }

rpgmaker commented 4 years ago

Thanks for the finding. Could you provide an example on how to reproduce this error.

Thanks,

mbacic1 commented 4 years ago

string str = "{\"SizedImages\":{\"$type\":\"System.Collections.Generic.List1[[y.Go.X.Contracts.Denormalization.TileSizedImage, y.Go.X.Contracts]], mscorlib\",\"$values\":[{\"Role\":\"photo\",\"Description\":\"ORF / ©Twentieth Century Fox Film Corporation. All rights reserved.\",\"IsMain\":true,\"Large\":{\"Url\":\"http://aaa.com/images/828r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Width\":828,\"Height\":465},\"Medium\":{\"Url\":\"http://aaa.com/images/414r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Width\":414,\"Height\":232},\"Small\":{\"Url\":\"http://aaa.com/images/200r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Width\":200,\"Height\":112}}]},\"SubTitle\":\"Malcolm, der Held\",\"EpisodeId\":\"41270363\",\"EpisodeNum\":\"1\",\"SeriesId\":\"1129\",\"SeasonNum\":null,\"ChannelId\":1,\"ChannelName\":\"ORFeins HD\",\"ChannelIcon\":\"https://aaa/1.png\",\"IsChannelPublished\":true,\"ChannelIconColorPrimaryUrl\":null,\"ChannelIconAndroidTvUrl\":null,\"Year\":2000,\"DurationSeconds\":1200,\"TimeshiftSeconds\":null,\"IsBlackouted\":false,\"IsLive\":false,\"IsPreviouslyShown\":false,\"IsRegionRestrictionEnabled\":false,\"IsTimeshiftEnabled\":true,\"IsCatchupEnabled\":true,\"IsNPvrEnabled\":true,\"IsLPvrEnabled\":false,\"RecordingId\":0,\"IsSeriesRecordingEnabled\":true,\"IsPpv\":false,\"HideInEpg\":false,\"VisibleOnlyIfBought\":false,\"Analytics\":{\"$type\":\"y.b.Tiles.Denormalization.TileAnalytics, y.b.Tiles.Contracts\",\"nur\":true},\"RegionRestrictions\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileRegionRestriction, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"PublishDate\":\"2019-10-14T02:02:58.813+02:00\",\"EndPublishDate\":\"9999-12-31T23:59:59.9999999+01:00\",\"Images\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.ImageDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Role\":\"photo\",\"Url\":\"http://aaa.com/images/828r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Description\":\"ORF / ©Twentieth Century Fox Film Corporation. All rights reserved.\",\"IsMain\":true,\"Width\":828,\"Height\":465,\"Type\":null,\"ExternalId\":null}]},\"Countries\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.CountryDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Codename\":\"usa\",\"Id\":361,\"Name\":\"USA\"}]},\"Categories\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.CategoryDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Codename\":\"serie\",\"Id\":20,\"Name\":\"Serie\",\"TypeCodename\":\"genre\"},{\"Codename\":\"comedyserie\",\"Id\":35,\"Name\":\"Comedyserie\",\"TypeCodename\":\"subcategory\"}]},\"Publications\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.PublicationPeriodDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"android\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"},{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"www\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"},{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"ios\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"},{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"android-tv\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"}]},\"Toplists\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.ToplistDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[]},\"People\":{\"$type\":\"System.Collections.Generic.Dictionary2[[System.String, mscorlib],[System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.PersonDataModel, yGo.Sdk.Abstractions]], mscorlib]], mscorlib\",\"director\":[{\"Id\":45508,\"Codename\":\"todd-holland\",\"FullName\":\"Todd Holland\",\"FirstName\":\"Todd\",\"LastName\":\"Holland\",\"RoleCodename\":\"director\",\"RoleName\":\"Regie\",\"FunctionDescription\":null}],\"musik\":[{\"Id\":129019,\"Codename\":\"they-might-be-giants\",\"FullName\":\"They Might Be Giants\",\"FirstName\":\"They\",\"LastName\":\"Might Be Giants\",\"RoleCodename\":\"musik\",\"RoleName\":\"Musik\",\"FunctionDescription\":null}],\"actor\":[{\"Id\":43782,\"Codename\":\"frankie-muniz\",\"FullName\":\"Frankie Muniz\",\"FirstName\":\"Frankie\",\"LastName\":\"Muniz\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Malcolm\"},{\"Id\":43783,\"Codename\":\"jane-kaczmarek\",\"FullName\":\"Jane Kaczmarek\",\"FirstName\":\"Jane\",\"LastName\":\"Kaczmarek\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Lois\"},{\"Id\":43784,\"Codename\":\"bryan-cranston\",\"FullName\":\"Bryan Cranston\",\"FirstName\":\"Bryan\",\"LastName\":\"Cranston\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Hal\"},{\"Id\":43785,\"Codename\":\"erik-per-sullivan\",\"FullName\":\"Erik Per Sullivan\",\"FirstName\":\"Erik\",\"LastName\":\"Per Sullivan\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Dewey\"},{\"Id\":43786,\"Codename\":\"christopher-kennedy-masterson\",\"FullName\":\"Christopher Kennedy Masterson\",\"FirstName\":\"Christopher\",\"LastName\":\"Kennedy Masterson\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Francis\"}],\"writer\":[{\"Id\":55589,\"Codename\":\"linwood-boomer\",\"FullName\":\"Linwood Boomer\",\"FirstName\":\"Linwood\",\"LastName\":\"Boomer\",\"RoleCodename\":\"writer\",\"RoleName\":\"Drehbuch\",\"FunctionDescription\":null},{\"Id\":45638,\"Codename\":\"victor-hammer\",\"FullName\":\"Victor Hammer\",\"FirstName\":\"Victor\",\"LastName\":\"Hammer\",\"RoleCodename\":\"writer\",\"RoleName\":\"Drehbuch\",\"FunctionDescription\":null}]},\"RelatedTiles\":{\"$type\":\"System.Collections.Generic.List1[[y.Sdk.Abstractions.DataModels.BaseTileDataModel, y.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Id\":\"prg.1684675\",\"Type\":\"prg\",\"OriginEntityId\":1684675,\"Codename\":\"orf1-1150013362\"},{\"Id\":\"prg.1678912\",\"Type\":\"prg\",\"OriginEntityId\":1678912,\"Codename\":\"orf1-1148618556\"},{\"Id\":\"prg.1672521\",\"Type\":\"prg\",\"OriginEntityId\":1672521,\"Codename\":\"orf1-1147720203\"},{\"Id\":\"prg.1672523\",\"Type\":\"prg\",\"OriginEntityId\":1672523,\"Codename\":\"orf1-1147720215\"},{\"Id\":\"prg.1674721\",\"Type\":\"prg\",\"OriginEntityId\":1674721,\"Codename\":\"orf1-1148617775\"},{\"Id\":\"prg.1674723\",\"Type\":\"prg\",\"OriginEntityId\":1674723,\"Codename\":\"orf1-1148617791\"},{\"Id\":\"prg.1676864\",\"Type\":\"prg\",\"OriginEntityId\":1676864,\"Codename\":\"orf1-1148618239\"},{\"Id\":\"prg.1676866\",\"Type\":\"prg\",\"OriginEntityId\":1676866,\"Codename\":\"orf1-1148618249\"},{\"Id\":\"prg.1686528\",\"Type\":\"prg\",\"OriginEntityId\":1686528,\"Codename\":\"orf1-1150579812\"},{\"Id\":\"prg.1686529\",\"Type\":\"prg\",\"OriginEntityId\":1686529,\"Codename\":\"orf1-1150579815\"},{\"Id\":\"prg.1686543\",\"Type\":\"prg\",\"OriginEntityId\":1686543,\"Codename\":\"orf1-1150579875\"},{\"Id\":\"prg.1686545\",\"Type\":\"prg\",\"OriginEntityId\":1686545,\"Codename\":\"orf1-1150579886\"},{\"Id\":\"prg.1678910\",\"Type\":\"prg\",\"OriginEntityId\":1678910,\"Codename\":\"orf1-1148618541\"},{\"Id\":\"prg.1684662\",\"Type\":\"prg\",\"OriginEntityId\":1684662,\"Codename\":\"orf1-1150013323\"},{\"Id\":\"prg.1674707\",\"Type\":\"prg\",\"OriginEntityId\":1674707,\"Codename\":\"orf1-1149472943\"}]},\"MediaFiles\":{\"$type\":\"System.Collections.Generic.List1[[y.Video.Contracts.Messages.MediaFileResult, y.Video.Contracts]], mscorlib\",\"$values\":[]},\"QualityLevels\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileQualityLevel, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"CatchupAvailableTo\":\"2019-10-28T14:40:00+01:00\",\"CatchupAvailableFrom\":\"2019-10-21T15:40:00+02:00\",\"Start\":\"2019-10-21T15:40:00+02:00\",\"Stop\":\"2019-10-21T16:00:00+02:00\",\"ChannelCodename\":\"orf1\",\"CanBuyInSvod\":false,\"Title\":\"Malcolm mittendrin\",\"OriginalTitle\":\"Malcolm in the Middle\",\"Description\":\"Der elfjährige Malcolm wächst gemeinsam mit seinen drei Brüdern in einer durchschnittlichen US-Familie auf. Was ihn von seinen Freunden unterscheidet, ist sein überdurchschnittlicher IQ von 165. Für Malcom ist das schlimmer, als radioaktiv verstrahlt zu sein. Sehr zu seinem Missfallen steckt ihn seine Mutter in eine Klasse für hochintelligente Kinder.\",\"ShortDescription\":\"Der elfjährige Malcolm wächst gemeinsam mit seinen drei Brüdern in einer durchschnittlichen US-Familie auf. Was ihn von seinen Freunden unterscheidet, ist sein überdurchschnittlicher IQ von 165. Für Malcom ist das schlimmer, als radioaktiv verstrahlt zu sein. Sehr zu seinem Missfallen steckt ihn seine Mutter in eine Klasse für hochintelligente Kinder.\",\"AgeRating\":0,\"IsAdultContent\":false,\"PurchaseOptions\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TilePurchaseOption, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"AvailableAudioTracks\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileMediaTrack, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"AvailableSubtitles\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileMediaTrack, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"HasAudioDescription\":false,\"HasSignLanguage\":false,\"HasSubtitles\":false,\"Id\":\"prg.1684673\",\"Type\":\"prg\",\"OriginEntityId\":1684673,\"Codename\":\"orf1-1150013357\"}";

                var x = NetJSON. NetJSON.DeserializeObject(str);`
rpgmaker commented 4 years ago

Thanks

mbacic1 commented 4 years ago

Any answear? Thank

rpgmaker commented 4 years ago

Sorry I had not got a chance to review it. I will take a look at it today. Thanks

rpgmaker commented 4 years ago

Still working on it. Thanks

rpgmaker commented 4 years ago

I could not reproduce the error above.

image

rpgmaker commented 4 years ago
[TestMethod]
        public void CanDeserializeLargeDictionary()
        {
            string str = "{\"SizedImages\":{\"$type\":\"System.Collections.Generic.List1[[y.Go.X.Contracts.Denormalization.TileSizedImage, y.Go.X.Contracts]], mscorlib\",\"$values\":[{\"Role\":\"photo\",\"Description\":\"ORF / ©Twentieth Century Fox Film Corporation. All rights reserved.\",\"IsMain\":true,\"Large\":{\"Url\":\"http://aaa.com/images/828r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Width\":828,\"Height\":465},\"Medium\":{\"Url\":\"http://aaa.com/images/414r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Width\":414,\"Height\":232},\"Small\":{\"Url\":\"http://aaa.com/images/200r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Width\":200,\"Height\":112}}]},\"SubTitle\":\"Malcolm, der Held\",\"EpisodeId\":\"41270363\",\"EpisodeNum\":\"1\",\"SeriesId\":\"1129\",\"SeasonNum\":null,\"ChannelId\":1,\"ChannelName\":\"ORFeins HD\",\"ChannelIcon\":\"https://aaa/1.png\",\"IsChannelPublished\":true,\"ChannelIconColorPrimaryUrl\":null,\"ChannelIconAndroidTvUrl\":null,\"Year\":2000,\"DurationSeconds\":1200,\"TimeshiftSeconds\":null,\"IsBlackouted\":false,\"IsLive\":false,\"IsPreviouslyShown\":false,\"IsRegionRestrictionEnabled\":false,\"IsTimeshiftEnabled\":true,\"IsCatchupEnabled\":true,\"IsNPvrEnabled\":true,\"IsLPvrEnabled\":false,\"RecordingId\":0,\"IsSeriesRecordingEnabled\":true,\"IsPpv\":false,\"HideInEpg\":false,\"VisibleOnlyIfBought\":false,\"Analytics\":{\"$type\":\"y.b.Tiles.Denormalization.TileAnalytics, y.b.Tiles.Contracts\",\"nur\":true},\"RegionRestrictions\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileRegionRestriction, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"PublishDate\":\"2019-10-14T02:02:58.813+02:00\",\"EndPublishDate\":\"9999-12-31T23:59:59.9999999+01:00\",\"Images\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.ImageDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Role\":\"photo\",\"Url\":\"http://aaa.com/images/828r_or1_191021_1535_7570e136_malcolm_mittendrin.jpg\",\"Description\":\"ORF / ©Twentieth Century Fox Film Corporation. All rights reserved.\",\"IsMain\":true,\"Width\":828,\"Height\":465,\"Type\":null,\"ExternalId\":null}]},\"Countries\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.CountryDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Codename\":\"usa\",\"Id\":361,\"Name\":\"USA\"}]},\"Categories\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.CategoryDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Codename\":\"serie\",\"Id\":20,\"Name\":\"Serie\",\"TypeCodename\":\"genre\"},{\"Codename\":\"comedyserie\",\"Id\":35,\"Name\":\"Comedyserie\",\"TypeCodename\":\"subcategory\"}]},\"Publications\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.PublicationPeriodDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"android\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"},{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"www\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"},{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"ios\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"},{\"From\":\"2019-10-14T02:02:58.813+02:00\",\"PlatformCodename\":\"android-tv\",\"To\":\"9999-12-31T23:59:59.9999999+01:00\"}]},\"Toplists\":{\"$type\":\"System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.ToplistDataModel, yGo.Sdk.Abstractions]], mscorlib\",\"$values\":[]},\"People\":{\"$type\":\"System.Collections.Generic.Dictionary2[[System.String, mscorlib],[System.Collections.Generic.List1[[yGo.Sdk.Abstractions.DataModels.PersonDataModel, yGo.Sdk.Abstractions]], mscorlib]], mscorlib\",\"director\":[{\"Id\":45508,\"Codename\":\"todd-holland\",\"FullName\":\"Todd Holland\",\"FirstName\":\"Todd\",\"LastName\":\"Holland\",\"RoleCodename\":\"director\",\"RoleName\":\"Regie\",\"FunctionDescription\":null}],\"musik\":[{\"Id\":129019,\"Codename\":\"they-might-be-giants\",\"FullName\":\"They Might Be Giants\",\"FirstName\":\"They\",\"LastName\":\"Might Be Giants\",\"RoleCodename\":\"musik\",\"RoleName\":\"Musik\",\"FunctionDescription\":null}],\"actor\":[{\"Id\":43782,\"Codename\":\"frankie-muniz\",\"FullName\":\"Frankie Muniz\",\"FirstName\":\"Frankie\",\"LastName\":\"Muniz\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Malcolm\"},{\"Id\":43783,\"Codename\":\"jane-kaczmarek\",\"FullName\":\"Jane Kaczmarek\",\"FirstName\":\"Jane\",\"LastName\":\"Kaczmarek\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Lois\"},{\"Id\":43784,\"Codename\":\"bryan-cranston\",\"FullName\":\"Bryan Cranston\",\"FirstName\":\"Bryan\",\"LastName\":\"Cranston\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Hal\"},{\"Id\":43785,\"Codename\":\"erik-per-sullivan\",\"FullName\":\"Erik Per Sullivan\",\"FirstName\":\"Erik\",\"LastName\":\"Per Sullivan\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Dewey\"},{\"Id\":43786,\"Codename\":\"christopher-kennedy-masterson\",\"FullName\":\"Christopher Kennedy Masterson\",\"FirstName\":\"Christopher\",\"LastName\":\"Kennedy Masterson\",\"RoleCodename\":\"actor\",\"RoleName\":\"Darsteller\",\"FunctionDescription\":\"Francis\"}],\"writer\":[{\"Id\":55589,\"Codename\":\"linwood-boomer\",\"FullName\":\"Linwood Boomer\",\"FirstName\":\"Linwood\",\"LastName\":\"Boomer\",\"RoleCodename\":\"writer\",\"RoleName\":\"Drehbuch\",\"FunctionDescription\":null},{\"Id\":45638,\"Codename\":\"victor-hammer\",\"FullName\":\"Victor Hammer\",\"FirstName\":\"Victor\",\"LastName\":\"Hammer\",\"RoleCodename\":\"writer\",\"RoleName\":\"Drehbuch\",\"FunctionDescription\":null}]},\"RelatedTiles\":{\"$type\":\"System.Collections.Generic.List1[[y.Sdk.Abstractions.DataModels.BaseTileDataModel, y.Sdk.Abstractions]], mscorlib\",\"$values\":[{\"Id\":\"prg.1684675\",\"Type\":\"prg\",\"OriginEntityId\":1684675,\"Codename\":\"orf1-1150013362\"},{\"Id\":\"prg.1678912\",\"Type\":\"prg\",\"OriginEntityId\":1678912,\"Codename\":\"orf1-1148618556\"},{\"Id\":\"prg.1672521\",\"Type\":\"prg\",\"OriginEntityId\":1672521,\"Codename\":\"orf1-1147720203\"},{\"Id\":\"prg.1672523\",\"Type\":\"prg\",\"OriginEntityId\":1672523,\"Codename\":\"orf1-1147720215\"},{\"Id\":\"prg.1674721\",\"Type\":\"prg\",\"OriginEntityId\":1674721,\"Codename\":\"orf1-1148617775\"},{\"Id\":\"prg.1674723\",\"Type\":\"prg\",\"OriginEntityId\":1674723,\"Codename\":\"orf1-1148617791\"},{\"Id\":\"prg.1676864\",\"Type\":\"prg\",\"OriginEntityId\":1676864,\"Codename\":\"orf1-1148618239\"},{\"Id\":\"prg.1676866\",\"Type\":\"prg\",\"OriginEntityId\":1676866,\"Codename\":\"orf1-1148618249\"},{\"Id\":\"prg.1686528\",\"Type\":\"prg\",\"OriginEntityId\":1686528,\"Codename\":\"orf1-1150579812\"},{\"Id\":\"prg.1686529\",\"Type\":\"prg\",\"OriginEntityId\":1686529,\"Codename\":\"orf1-1150579815\"},{\"Id\":\"prg.1686543\",\"Type\":\"prg\",\"OriginEntityId\":1686543,\"Codename\":\"orf1-1150579875\"},{\"Id\":\"prg.1686545\",\"Type\":\"prg\",\"OriginEntityId\":1686545,\"Codename\":\"orf1-1150579886\"},{\"Id\":\"prg.1678910\",\"Type\":\"prg\",\"OriginEntityId\":1678910,\"Codename\":\"orf1-1148618541\"},{\"Id\":\"prg.1684662\",\"Type\":\"prg\",\"OriginEntityId\":1684662,\"Codename\":\"orf1-1150013323\"},{\"Id\":\"prg.1674707\",\"Type\":\"prg\",\"OriginEntityId\":1674707,\"Codename\":\"orf1-1149472943\"}]},\"MediaFiles\":{\"$type\":\"System.Collections.Generic.List1[[y.Video.Contracts.Messages.MediaFileResult, y.Video.Contracts]], mscorlib\",\"$values\":[]},\"QualityLevels\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileQualityLevel, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"CatchupAvailableTo\":\"2019-10-28T14:40:00+01:00\",\"CatchupAvailableFrom\":\"2019-10-21T15:40:00+02:00\",\"Start\":\"2019-10-21T15:40:00+02:00\",\"Stop\":\"2019-10-21T16:00:00+02:00\",\"ChannelCodename\":\"orf1\",\"CanBuyInSvod\":false,\"Title\":\"Malcolm mittendrin\",\"OriginalTitle\":\"Malcolm in the Middle\",\"Description\":\"Der elfjährige Malcolm wächst gemeinsam mit seinen drei Brüdern in einer durchschnittlichen US-Familie auf. Was ihn von seinen Freunden unterscheidet, ist sein überdurchschnittlicher IQ von 165. Für Malcom ist das schlimmer, als radioaktiv verstrahlt zu sein. Sehr zu seinem Missfallen steckt ihn seine Mutter in eine Klasse für hochintelligente Kinder.\",\"ShortDescription\":\"Der elfjährige Malcolm wächst gemeinsam mit seinen drei Brüdern in einer durchschnittlichen US-Familie auf. Was ihn von seinen Freunden unterscheidet, ist sein überdurchschnittlicher IQ von 165. Für Malcom ist das schlimmer, als radioaktiv verstrahlt zu sein. Sehr zu seinem Missfallen steckt ihn seine Mutter in eine Klasse für hochintelligente Kinder.\",\"AgeRating\":0,\"IsAdultContent\":false,\"PurchaseOptions\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TilePurchaseOption, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"AvailableAudioTracks\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileMediaTrack, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"AvailableSubtitles\":{\"$type\":\"System.Collections.Generic.List1[[y.b.Tiles.Denormalization.TileMediaTrack, y.b.Tiles.Contracts]], mscorlib\",\"$values\":[]},\"HasAudioDescription\":false,\"HasSignLanguage\":false,\"HasSubtitles\":false,\"Id\":\"prg.1684673\",\"Type\":\"prg\",\"OriginEntityId\":1684673,\"Codename\":\"orf1-1150013357\"}";

            var obj = NetJSON.DeserializeObject(str);
            Assert.IsNotNull(obj);
        }
rpgmaker commented 4 years ago

Are you running your code in multiple threads by any chance?

rpgmaker commented 4 years ago

And which version of .net are you using to test this code?

rpgmaker commented 4 years ago

The following is the only place it could fail based on your callstack, but it is also interesting that the code is in a lock statement.

image

mbacic1 commented 4 years ago

Xamarin Android project Other bug System.InvalidProgramException: 'Invalid IL code in (wrapper dynamic-method) object:DeserializeValueTextReaderSettings (System.IO.TextReader,NetJSON.NetJSONSettings): IL_0006: ldarg.2
at (wrapper managed-to-native) System.Delegate.CreateDelegate_internal(System.Type,object,System.Reflection.MethodInfo,bool) at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) [0x002f0] in <46c2fa109b574c7ea6739f9fe2350976>:0 at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) [0x00000] in <46c2fa109b574c7ea6739f9fe2350976>:0 at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00029] in <46c2fa109b574c7ea6739f9fe2350976>:0 at NetJSON.NetJSON+DynamicNetJSONSerializer1[T].CreateDeserializerWithTextReaderSettings () [0x0007c] in <a4a2f81e447047adaedfa2bcf078651c>:0 at NetJSON.NetJSON+DynamicNetJSONSerializer1[T]..ctor () [0x0001e] in :0 at NetJSON.NetJSON+NetJSONCachedSerializer1[T].GetSerializer () [0x00000] in <a4a2f81e447047adaedfa2bcf078651c>:0 at NetJSON.NetJSON+NetJSONCachedSerializer1[T]..cctor () [0x00000] in :0

rpgmaker commented 4 years ago

I will look into it. So, the error only occurs in xamarin?

mbacic1 commented 4 years ago

yes

rpgmaker commented 4 years ago

What is the easiest way for me to test this without having to setup xamarin? Could I create a windows phone app and set the target to it? Thanks

mbacic1 commented 4 years ago

I think Xamarin needs to be setup and create new Mobile App ( Xamarin.Forms)

rpgmaker commented 4 years ago

I see. I will try to give it a shot tomorrow. Thanks

mbacic1 commented 4 years ago

Any news?

rpgmaker commented 4 years ago

Sorry, have not been able to resolve it yet. Trying to figure it out.

rpgmaker commented 4 years ago

The first one you posted is not reproducible for me. Could you create a sample project that give the error?

Thanks,

rpgmaker commented 4 years ago

Will you be able to help me with a sample project that reproduce the error? Thanks

rpgmaker commented 4 years ago

I am not able to setup an environment with xamarim. Could you reproduce this issue in a different way with just .net standard/core?

rpgmaker commented 4 years ago

Any thought?

rpgmaker commented 4 years ago

Any Thought?

rpgmaker commented 4 years ago

Still waiting on an example that reproduce the problem if possible. Since i have not gotten to been able to reproduce the issue myself.

Thanks,

rpgmaker commented 4 years ago

I will close this issue out soon. You can reopen it once there is an example to reproduce the issue.