-
Notifications
You must be signed in to change notification settings - Fork 770
Description
Describe the bug
The following exception is thrown after the web api is started and the first page is loading. Azure Ad authentication is enabled.
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at Microsoft.SemanticKernel.KernelExtensions.Build(IKernelBuilder builder)
at CopilotChat.WebApi.Services.SemanticKernelProvider.GetCompletionKernel() in C:\Repos\chat-copilot\webapi\Services\SemanticKernelProvider.cs:line 28
at CopilotChat.WebApi.Extensions.SemanticKernelExtensions.<>c.b__2_0(IServiceProvider sp) in C:\Repos\chat-copilot\webapi\Extensions\SemanticKernelExtensions.cs:line 55
at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at lambda_method110(Closure, Object, HttpContext, IServiceProvider)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
To Reproduce
Steps to reproduce the behavior:
- Start the web api project.
- Open browser and navigate to https://localhost:3000/.
- See error
Expected behavior
It doesn't happen all the time, just occasionally.