Dapr Actor startup in AspNetCore - Issue in .NET 8
gverstraete opened this issue · comments
Gillian commented
Since dotnet 8 we get this warning if we want to map the Actor Handlers in AspNet:
https://learn.microsoft.com/en-us/aspnet/core/diagnostics/asp0014?view=aspnetcore-8.0
#pragma warning disable ASP0014 // Suggest using top level route registrations
app.UseEndpoints(endpoints =>
{
// Register actors handlers that interface with the Dapr runtime.
endpoints.MapActorsHandlers();
});
#pragma warning restore ASP0014 // Suggest using top level route registrations
Also inside the docs the recommendation is to use endpoints.MapActorHandlers() inside the UseEndpoints:
https://docs.dapr.io/developing-applications/sdks/dotnet/dotnet-actors/dotnet-actors-howto/#register-actor-runtime-with-aspnet-core-startup
We can work around this by putting the pragma's around it, but would prefer a better solution.
Thanks for the feedback!