grollmus/BuildNotifications

Crash during parsing of predefined.json

Closed this issue · 0 comments

2020-09-02 09:56:29.5635 ConfigurationSerializer Failed to load predefined configuration container.Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'BuildNotifications.Core.Config.ConfigurationSerializer+PredefinedConfigurationContainer' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureArrayContract(JsonReader reader, Type objectType, JsonContract contract)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at BuildNotifications.Core.Utilities.Serializer.Deserialize[T](String serialized)
at BuildNotifications.Core.Config.ConfigurationSerializer.LoadPredefinedConfigurationContainer(String fileName)
2020-09-02 09:56:29.5738 BuildNotifications.App Global unhandled exception occurred.System.Windows.Markup.XamlParseException: Durch den Aufruf des Konstruktors für Typ "BuildNotifications.MainWindow", der den angegebenen Bindungseinschränkungen entspricht, wurde eine Ausnahme ausgelöst.
---> System.InvalidOperationException: Sequence contains no matching element
at System.Linq.ThrowHelper.ThrowNoMatchException()
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at BuildNotifications.Core.Config.ConfigurationBuilder.LoadConfiguration()
at BuildNotifications.Core.CoreSetup..ctor(IPathResolver pathResolver, IDistributedNotificationReceiver notificationReceiver, IDispatcher uiDispatcher)
at BuildNotifications.ViewModel.MainViewModel..ctor(IViewProvider viewProvider)
at BuildNotifications.MainWindow..ctor()