问题
I've download new blazor webassembly project template with
dotnet new --install Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview3.20168.3
Next I created in Visual Studio 2019 new Blazor WebAssembly project with enabled "Asp.Net Core hosted" and "authenthication". I named it "27MarchTemplate"
Now I Run project and get
System.InvalidOperationException: 'Client '27MarchTemplate.Client' not found.'
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ClientCollection.get_Item(String key)
at Microsoft.AspNetCore.ApiAuthorization.IdentityServer.DefaultClientRequestParametersProvider.GetClientParameters(HttpContext context, String clientId)
at _27MarchTemplate.Server.Controllers.OidcConfigurationController.GetClientRequestParameters(String clientId) in C:\VSProjs\BlazorStudy\27MarchTemplate\27MarchTemplate\27MarchTemplate\Server\Controllers\OidcConfigurationController.cs:line 22
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
回答1:
It was a bad idea to start the solution\project name with digits.
I just created new solution without digits in its name, and the error went away.
来源:https://stackoverflow.com/questions/60881628/system-invalidoperationexception-client-27marchtemplate-client-not-found