question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

22reactions
TanvirArjelcommented, Apr 23, 2019

@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?

7reactions
thanhtai9606commented, Oct 3, 2019

@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?

Just like this only services.AddMvc(option => option.EnableEndpointRouting = false) that worked for me!! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using 'UseMvc' to configure MVC is not supported while ...
EnableEndpointRouting = false' inside 'ConfigureServices'. I understand that by setting EnableEndpointRouting to false I can solve the issue, ...
Read more >
MVC1005: Cannot use UseMvc with Endpoint Routing
Using MVC via UseMvc or UseMvcWithDefaultRoute requires an explicit opt-in inside Startup.ConfigureServices . This is required because MVC ...
Read more >
Resolved - Error While Upgrading Solution From ASP.NET ...
To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(…). Source=Microsoft.AspNetCore.Mvc.Core ...
Read more >
Using useMvc to Configure MVC is not supported ... - YouTube
When you are using mvc method or routing as traditional pattern (DOTNET core 2.0, 2.1 routing pattern ) into your project then must...
Read more >
Using 'UseMvc' to configure MVC is not supported while ...
Error resolution for UseMvc to configure MVC is not supported while using Endpoint Routing. Please set MvcOptions.EnableEndpointRouting = false to fix the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found