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

Debugger: The request reached the end of the pipeline without executing the endpoint: 'Fallback {*path:nonfile}' #294

Closed
Bananas-Are-Yellow opened this issue Mar 14, 2023 · 3 comments

Comments

@Bananas-Are-Yellow
Copy link

Bananas-Are-Yellow commented Mar 14, 2023

Using the HelloWorld sample, I created a launch.json file as follows:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "blazorwasm",
            "name": "Launch and Debug Blazor WebAssembly Application",
            "request": "launch",
            "hosted": true,
            "program": "${workspaceFolder}/src/HelloWorld.Server/bin/Debug/net7.0/HelloWorld.Server.dll",
            "cwd": "${workspaceFolder}/src/HelloWorld.Server",
            "url": "http://localhost:5000"
        }
    ]
}

When I go to Run and Debug (Ctrl+Shift+D) and start debugging, I get this output:

info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost/_framework/debug/ws-proxy?browser=ws%3A%2F%2F127.0.0.1%3A46481%2Fdevtools%2Fbrowser%2F89a7c53f-6382-4440-b727-974415bb8174 - -
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost/_framework/debug/ws-proxy?browser=ws%3A%2F%2F127.0.0.1%3A46481%2Fdevtools%2Fbrowser%2F89a7c53f-6382-4440-b727-974415bb8174 - -

Then there are a few lines about loading DLLs and skipping load symbols, followed by this error:

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMP4BRK8A45B", Request id "0HMP4BRK8A45B:00000001": An unhandled exception was thrown by the application.
      System.InvalidOperationException: The request reached the end of the pipeline without executing the endpoint: 'Fallback {*path:nonfile}'. Please register the EndpointMiddleware using 'IApplicationBuilder.UseEndpoints(...)' if using routing.
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.<Build>b__18_0(HttpContext context)
         at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Components.WebAssembly.Server.ContentEncodingNegotiator.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Builder.ComponentsWebAssemblyApplicationBuilderExtensions.<>c__DisplayClass0_0.<<UseBlazorFrameworkFiles>b__2>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Microsoft.AspNetCore.Server.Kestrel: Error: Connection id "0HMP4BRK8A45B", Request id "0HMP4BRK8A45B:00000001": An unhandled exception was thrown by the application.

I don't have a launchSettings.json file, just a launch.json file.

Any idea what's going on here?

@Bananas-Are-Yellow
Copy link
Author

I've solved it. A call to UseWebAssemblyDebugging needs to be made in the Startup.Configuration method in the Server project.

    member this.Configure(app: IApplicationBuilder, env: IWebHostEnvironment) =
        if env.IsDevelopment() then
            app.UseWebAssemblyDebugging()

        app
            .UseAuthentication()
            .UseRemoting()
            .UseStaticFiles()
            .UseRouting()
            .UseBlazorFrameworkFiles()
            .UseEndpoints(fun endpoints ->
#if DEBUG
                endpoints.UseHotReload()
#endif
                endpoints.MapBlazorHub() |> ignore
                endpoints.MapFallbackToBolero(Index.page) |> ignore)
        |> ignore

@Tarmil
Copy link
Member

Tarmil commented Mar 19, 2023

Ah, yes. This would be worth adding in the project template.

@Tarmil
Copy link
Member

Tarmil commented Apr 10, 2023

This was added in version 0.21.11 of the project template.

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

No branches or pull requests

2 participants