This repository has been archived by the owner on May 16, 2022. It is now read-only.
Error with ASP.NET Core 3.1 #186
Comments
I managed to get it working with the code from https://michaelscodingspot.com/the-battle-of-c-to-json-serializers-in-net-core-3/ classes Utf8JsonInputFormatter and Utf8JsonOutputFormatter. |
I'm got the same problem. Microsoft disabled by default the synchronous i/o and announced this change here. I'm planing to migrate to System.Text, but you can use this workaround instead: public void ConfigureServices(IServiceCollection services)
{
services.Configure<KestrelServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
// If using IIS:
services.Configure<IISServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
// Other services.
} |
This was referenced Feb 4, 2020
I think it is better if you don't allow synchronous IO, because it can impact your performance. You can implement the solution from this PR or the solution from @ramon-garcia which is the kind the same. Just copy the file to your solution, or some common library and inject this formatter. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When attempting to use Utf8Json formatter with ASP.NET Core 3, the following error appears:
The text was updated successfully, but these errors were encountered: