Repository navigation
Update giraffe sample to .NET 6 alpha - #6891
Conversation
a31d507 to
c726a94
Compare
|
this one is ready |
| |> ignore) | ||
| .Build() | ||
| .Run() | ||
| let configureApp (appBuilder : IApplicationBuilder) = |
There was a problem hiding this comment.
Glancing at this, is there anything here that could cause a performance change? UseKestrel being dropped? Anything else?
There was a problem hiding this comment.
AFAIK that's how hosting is initialized in asp.net core 6. /cc @davidfowl
There was a problem hiding this comment.
This could be a bit more minimal overall:
let builder = WebApplication.CreateBuilder(args)
builder.Services.AddGiraffe()
.AddSingleton(jsonSerializer) |> ignore
let app = builder.Build()
app.UseGiraffe HttpHandlers.endpoints |> ignore
app.Run()There was a problem hiding this comment.
There is another PR coming that disables logging. Could this be a change to asp.net core 5 that affected performance? Was logging enabled before?
There was a problem hiding this comment.
And thanks for the help!
There was a problem hiding this comment.
@davidfowl for the avoidance of doubt, is that because these things are all registered by default:
https://github.com/dotnet/aspnetcore/blob/4226c40df06f1e2edc4576ea2b1c787d69238bb4/src/DefaultBuilder/src/WebApplicationBuilder.cs#L238-L299
There was a problem hiding this comment.
@davidfowl AddRouting could indeed go but removing UseRouting errors with:
Unhandled exception. System.InvalidOperationException: EndpointRoutingMiddleware matches endpoints setup by EndpointMiddleware and so must be added to the request execution pipeline before EndpointMiddleware. Please add EndpointRoutingMiddleware by calling 'IApplicationBuilder.UseRouting' inside the call to 'Configure(...)' in the application startup code.
Are we expected to add this inside the UseGiraffe implementation?
There was a problem hiding this comment.
Change this to MapGiraffeEndpoints instead of UseGiraffe
cc @dustinmoris
There was a problem hiding this comment.
When the EndpointRouting namespace is open then the UseGiraffe extension method is doing the correct thing already.
* Update giraffe sample to .NET 6 * Use WebApplication in Giraffe host * Update Npgsql
This updates the Giraffe sample to .NET 6 as soon as Giraffe 6 comes out