New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRounting = false' inside 'ConfigureServices'. #9542
Comments
There's a section in this blog post called "Endpoint Routing Updates" that are relevant here. https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-0-preview-4/ |
@davidfowl and @rynowak I have created a brand new ASP.NET Core Angular application with
that means |
Just like this only |
I see the 3.0 Spa templates using endpoint routing: https://github.com/aspnet/AspNetCore/blob/master/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/Startup.cs#L105 Are you sure you've updated correctly? |
@rynowak Yes! I see endpoint routing has been added in ASP.NET Core 3.0 GA release. If you want you can close the issue with marking as fixed! Thank you. |
fix services.AddMvc to: services.AddMvc(option => option.EnableEndpointRouting = false); dotnet/aspnetcore#9542
EnableEndpointRouting should be set to false. Otherwise people will get error: Application startup exception: System.InvalidOperationException: Endpoint Routing does not support 'IApplicationBuilder.UseMvc(...)'. To use 'IApplicationBuilder.UseMvc' set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices(...). The solution is even proposed in stack trace. Issue was opened on dotnet/aspnetcore#9542 and it is explained there what should be done.
like this only. i worked for me. |
* feat: update to asp.net core 3.0 preview 9 * fix : AspDotNetLogger unittest * feat: update generic host and useMvc 1、Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing dotnet/aspnetcore#9542 2、 use IHost and IHostBuilder * feat : update .net core 3.0 rc1 * eureka extension * fixed logger formatter error * fixed synchronous operations are disallowed of ReadToEnd method * fix log tests * Flush method of FakeStream should do nothing * Update ContentTests.cs * Fixed ws tests * feat: delelte comment code * feat: update .net core 3.0 RTM * Update OcelotBuilderTests.cs * Update .travis.yml mono 6.0.0 and dotnet 3.0.100 * Update Ocelot.IntegrationTests.csproj update Microsoft.Data.SQLite 3.0.0 * Update .travis.yml * feat: remove FrameworkReference 1、 remove FrameworkReference 2、 update package * add appveyor configuration to use version of VS2019 with dotnet core 3 sdk support * update obsoleted SetCollectionValidator method * Swap out OpenCover for Coverlet * Bump Cake to 0.35.0 * Downgrade coveralls.net to 0.7.0 Fix disposing of PollConsul instance * Remove environment specific path separator * Do not return ReportGenerator on Mac/Linux * Remove direct dependency on IInternalConfiguration * Fix ordering of variable assignment * Fix broken tests * Fix acceptance tests for Consul
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:Then the warning goes away. My question is if I want to use
EndpointRounting
then should I remove the following code:if not then what change I have to make?
The text was updated successfully, but these errors were encountered: