Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard AllowSynchronousIO #1386

Closed
Leeemons opened this issue Apr 2, 2019 · 4 comments
Closed

Dashboard AllowSynchronousIO #1386

Leeemons opened this issue Apr 2, 2019 · 4 comments

Comments

@Leeemons
Copy link

Leeemons commented Apr 2, 2019

Hi,
I migrated app to netcoreapp3.0 and AllowSynchronousIO is set false by default.
When dashboard is trying get resource, exception will throw.

InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.

Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpResponseStream.Write(byte[] buffer, int offset, int count) System.IO.Stream.CopyTo(Stream destination, int bufferSize) System.IO.Stream.CopyTo(Stream destination) Hangfire.Dashboard.EmbeddedResourceDispatcher.WriteResource(DashboardResponse response, Assembly assembly, string resourceName) Hangfire.Dashboard.CombinedResourceDispatcher.WriteResponse(DashboardResponse response) Hangfire.Dashboard.EmbeddedResourceDispatcher.Dispatch(DashboardContext context) Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

dotnet/aspnetcore#4774
https://www.strathweb.com/2019/02/be-careful-when-manually-handling-json-requests-in-asp-net-core/

Hangfire v1.7.0

@odinserj odinserj added this to the 1.7.1 milestone Apr 2, 2019
@odinserj
Copy link
Member

odinserj commented Apr 2, 2019

Thanks for reporting, the fix is available in the CI NuGet feed https://ci.appveyor.com/nuget/hangfire in version 1.7.0-build-02847. 1.7.1 will be released later just in case there are other bugs, meanwhile please allow the sync IO or use version from CI feed (and please let me know about the results).

@Leeemons
Copy link
Author

Leeemons commented Apr 9, 2019

@odinserj thank you! but I dont see version 1.7.0-build-02847 in CI NuGet. The latest version is 1.6.0-build-02064

@odinserj
Copy link
Member

Ah sorry, I gave the wrong version, the correct one is 1.7.0-build-02849, and you can download it from AppVeyor directly just in case – https://ci.appveyor.com/project/odinserj/hangfire-525/builds/23652781/artifacts.

@Leeemons
Copy link
Author

@odinserj it's work, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants