System.InvalidOperationException: 'Client '27MarchTemplate.Client' not found.'

寵の児 提交于 2020-04-07 07:08:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!