1
votes

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
Did you update your Visual Studio 2019 as well? - enet
@enet No, I didn't. It is a good idea. I will try when I return to my office PC. - 3per
I've created the same app as yours, and it does not work as well. The error I get is different than yours, but clearly there is an issue with the new package. Let's wait and see how the Blazor team are going to deal with it. - enet
I'd advise you to stick to the authentication system provided by Blazor. Just wait for a while until bugs are cleaned. Meanwhile, why don't you reverse to the previous versions. - enet
I had same problem, was using older version of VS, updated it to last (16.6.5) and now is working ok - danfer

1 Answers

1
votes

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.