mercoledì 19 aprile 2023

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

Durante lo sviluppo softwtare con la tecnologia Asp.Net MVC Core, può verificarsi l'errore :

"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",

questo perchè manca probabilmente la chiamata al metodo "UseRouting".
Nell'evento "Configure" inserire la chiamata al metodo "UseRouting"  prima dell'istruzione " app.UseEndpoints(endpoints =>......" : 


app.UseRouting();

app.UseAuthentication();
            app.UseAuthorization();
            app.UseEndpoints(endpoints =>
            {.......

Nessun commento: