Skip to content

Compatibility issue with .Net Core 2.2.0 #19

Open
@fschlaef

Description

When attempting to use this package on ASP.Net Core 2.2.0, I get the following exception at startup :

System.InvalidOperationException: Cannot use 'AspNetCore.RouteAnalyzer.Inner.Router' with Endpoint Routing.
   at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action`1 configureRoutes)
   at Application.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime) in C:\me\Startup.cs:line 203
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

This only happends when using MVC compatibility version 2.2 in ConfigureServices :

services.AddMvc()
     .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)

The only workaround I found is to rollback to 2.1 compatibility mode :

services.AddMvc()
     .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)

However this prevents from benefiting from 2.2.0 improvements, and as such it is not a real workaround.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions