builder.Services.AddMvc().AddControllersAsServices(); can not work #126
-
create app
add code
exception
|
Beta Was this translation helpful? Give feedback.
Answered by
mythz
Jul 30, 2024
Replies: 2 comments 2 replies
-
All ASP .NET Identity Auth templates are only configured to use Endpoint Routing. For older MVC template that doesn't use Endpoint Routing, you can use |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can resolve this by manually registering the dependency: services.AddSingleton<ServiceStack.Host.ServiceController>(c => HostContext.ServiceController);
services.AddMvc(options => options.EnableEndpointRouting = false).AddControllersAsServices(); We'll pre-register it in the next version. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
1257960069
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can resolve this by manually registering the dependency:
We'll pre-register it in the next version.