Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

NancyFx not working on .Net Core 3 #2994

Open
rock85mx opened this issue Nov 15, 2019 · 3 comments
Open

NancyFx not working on .Net Core 3 #2994

rock85mx opened this issue Nov 15, 2019 · 3 comments

Comments

@rock85mx
Copy link

  • I just to migrate mi proyect from net core 2.2 to 3.0, and nancy dosnt work.

  • Nancy version: 2.0

  • Microsoft.Owin: 3.0

  • Startup.cs

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseOwin(b => b.UseNancy());
}

using Nancy;

namespace WebApplicationCore
{
public class Index : NancyModule
{
public Index()
{
Get("", args => Root());
}

    public Response Root()
    {
        return Response.AsText("Server up");
    }
}

}

@klym1
Copy link

klym1 commented Nov 15, 2019

I've had exactly the same problem! It appeared that starting from .Net Core 3 it is forbidden to use Kestrel's synchronous API by default (the sync API is apparently used by Nancy as a middleware). So the fast workaround for this issue is to allow synchronous API in Kestrel settings:

var host = new WebHostBuilder()
      .UseKestrel(o =>
      {
      o.AllowSynchronousIO = true;
      })

But, of course, it would be much better if somebody made a PR and let Nancy Owin wrapper use async api.

@RamkiPannerselvam
Copy link

Even I was facing the same issue when I use the latest version of .NET CORE 3.1 and the nancy version is 3.1.0. After a lot of research, I have found this answer. The above solution is working fine.

The alternative solution is, you can downgrade the nancy version to 2.2.0 if you want.

@moh-hassan
Copy link

a wiki page Hosting Nancy on ASP .NET Core 3.1 (using Kestrel) describe in detail how to use NancyFx with ASP.NET CORE 3.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants