Could not load type Microsoft.AspNetCore.Internal.EndpointRoutingApplicationBuilderExtensions from assembly Microsoft.AspNetCore.Routing Ver=

I am upgrading my dotnet core 2.2 app to 3.1. I have multiple services and one base library all initially developed in 2.2 AspDotNetCore. My plan is:

  1. First covert my base library to Dotnet standard 2.1. Which I am able to do successfully with few reference changes.
  2. Now I am referencing this base 2.1 dotnet standard library in other AspDotnet core app which I am upgrading from 2.2 dotnet core to 3.1 dotnet core. Here I am getting error as follows.

Could not load type ‘Microsoft.AspNetCore.Internal.EndpointRoutingApplicationBuilderExtensions’ from assembly ‘Microsoft.AspNetCore.Routing, Version=, Culture=neutral, PublicKeyToken=adb9793829ddae60’

The at which this error occurs is at UseMvcCoreServices which is my custom extension mention:

 public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHttpContextAccessor ca, IHostApplicationLifetime applicationLifetime)
        if (env.IsDevelopment())

            .UseMvcCoreServices(Configuration, Logger, env)
            .UseElasticClient(Configuration, Logger);

I followed lots of link as:
[] and

But yet no luck. Can someone help me. It’s really critical for me.


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

By default the ASP.NET 3.0 and later versions have Endpoint routing enabled. You only have to add app.UseRouting()’ in the Configure() method of the Startup.cs file, before any other middleware that needs to access routing.

For details please visit this link:

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x