nickelc / modio.net

Modio.NET - A mod.io API Client Library for .NET
Apache License 2.0
17 stars 6 forks source link

Modio.ApiException.GetApiError throws an exception #2

Closed jswigart closed 1 year ago

jswigart commented 2 years ago

Whenever I get an API error, I get the following exception

Exception thrown: 'System.NotSupportedException' in System.Text.Json.dll Deserialization of reference types without parameterless constructor is not supported. Type 'Modio.Models.ApiError'

The fix for this is simply to add a default constructor to class ApiError

nickelc commented 2 years ago

What framework version do you use?

nickelc commented 2 years ago

Ok, I found a link related to the issue. https://learn.microsoft.com/en-us/dotnet/core/compatibility/serialization/5.0/non-public-parameterless-constructors-not-used-for-deserialization

It's fixed with ebd5427.

jswigart commented 2 years ago

Unfortunately this app is still dotnet core 3.1