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 issueI 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:
- Created 4 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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!! 😃