Monthly Archive 26 February 2021

ByPatrick

Migration of a webservice .net code 2.2 in 3.1

Today, we have merged two projects, one in .net core 2.2, the other in 3.1.

At the first launch, we got the information that Microsoft.AspNetCore.Razor.Design 2.2 was not compatible in .net core 3.1.

A forum told us that this bookstore was now integrated with .net core 3.1 and that it was enough to remove it from the project with the help of the nugget manager.

During the 2nd launch, we were able to launch the application, but on the first call of a method: boom:

We then added in Startup.cs > ConfigureServices method:

Services.AddMvc (option > option.EnableEndpointRouting - false)

And now the webservice is usable.

Thanks to https://stackoverflow.com/questions/57684093/using-usemvc-to-configure-mvc-is-not-supported-while-using-endpoint-routing