Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...) #24099
Unanswered
HanumantappaBudihal
asked this question in
General
Replies: 1 comment
-
Yes this is by design, please see the migration guide https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#mvc-service-registration |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)
When try to start the API app (.NET Core 3.1 framewrok) , getting the below error
System.InvalidOperationException
HResult=0x80131509
Message=Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)'. To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(...).
Source=Microsoft.AspNetCore.Mvc.Core
StackTrace:
at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action`1 configureRoutes)
at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app)
at Hexagonal.RESTApiWithJWTSample.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in D:\8.GitHub\HanumantappaBudihal\ASP.NET-Core-JWT-Authentication\src\Hexagonal.JWTAuthentication\Hexagonal.RESTApiWithJWTSample\Startup.cs:line 42
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
To Reproduce
Trying to build REST api using .NET Core 3.1 and EF Core
Exceptions (if any)
▶ | TargetSite | {Microsoft.AspNetCore.Builder.IApplicationBuilder UseMvc(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Action`1[Microsoft.AspNetCore.Routing.IRouteBuilder])} | System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
▶ | Data | {System.Collections.ListDictionaryInternal} | System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
Further technical details
Version: 3.1.300
Commit: b2475c1295
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.300\
Host (useful for support):
Version: 3.1.4
Commit: 0c2e69caa6
.NET Core SDKs installed:
2.1.514 [C:\Program Files\dotnet\sdk]
3.1.300 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Beta Was this translation helpful? Give feedback.
All reactions