profile
viewpoint

Ask questionsUsing 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRounting = false' inside 'ConfigureServices'.

I am getting the following warning from after upgrading an my ASP.NET Core Angular application from ASP.NET Core 3.0 Preview 3 to ASP.NET Core 3.0 Preview 4.

1>Startup.cs(75,13,80,15): warning MVC1005: Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRounting = false' inside 'ConfigureServices'.

Then if I set MvcOptions.EnableEndpointRounting = false as follows:

 services.AddMvc(option => option.EnableEndpointRouting = false)
                .AddNewtonsoftJson();

Then the warning goes away. My question is if I want to use EndpointRounting then should I remove the following code:

app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });

if not then what change I have to make?

aspnet/AspNetCore

Answer questions TanvirArjel

@davidfowl and @rynowak I have created a brand new ASP.NET Core Angular application with .NET Core 3.0 preview 4 SDK and I have found the following:

services.AddMvc(option => option.EnableEndpointRouting = false) .AddNewtonsoftJson();

that means Endpoint Routing is disabled by default on ASP.NET Core 3.0 Angular application. My question is why it is disabled? Does ASP.NET Core 3.0 preview 4 SPA not support Endpoint Routing yet?

useful!

Related questions

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies hot 523
ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY when clean webapi template hot 505
Restore MvcJsonOptions to ASP.NET Core 3.0 as a type forward? hot 420
The SPA default page middleware could not return the default page '/index.html' in production application hot 310
Issue with BuildServiceProvider() in ConfigureServices() hot 285
HTTP Error 500.30 - ANCM In-Process Start Failure hot 282
HTTP Error 500.30 - ANCM In-Process Start Failure hot 249
Calling Request.EnableRewind throw on 3.0.0-preview7 hot 219
ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY when clean webapi template hot 206
DataProtection - CryptographicException when using EntityFramework as Key Storage Provider hot 181
error CS1503: Argument 2: cannot convert from 'method group' to 'EventCallback' hot 160
Error: Server returned handshake error: Handshake was canceled. hot 152
Blazor - rzc generate exited with code 1. DotNet Core 3.0.100-preview8-013656 hot 150
IIS in-process hosting incorrectly throws ConnectionResetException for HTTP POST hot 149
NullReferenceException in IISHttpContext hot 135
Github User Rank List