aspire
aspire copied to clipboard
[WebToolsE2E][Aspire] Creating web app with MS Identity auth and aspire checked, F5 failed with 'This service descriptor is keyed. Your service provider may not support keyed services.'
REGRESSION INFO: Also reproduces on Aspire 8.0 P4 and Aspire 8.0 P5
INSTALL STEPS
-
Clean machine: Win11 x64 23h2 ENU
-
Install VS 17.10.0 Preview 5 FB, Preview channel
- Web workload
- Includes Aspire 8.0.0-preview.6.24214.1
- Includes .NET SDK 8.0.300-preview.24203.14 and runtime 8.0.2
- Apply dotnet-tools feed
REPRO STEPS
- New > Project > ASP.NET Core Web App > .NET 8.0 > Microsoft identity platform > Check 'Enlist in .NET Aspire orchestration' > Create
- In the popped window, select 'Tenants' to 'Microsoft' > Create a new application > Next > Next > Finish
- F5
ACTUAL
F5 failed with exception: This service descriptor is keyed. Your service provider may not support keyed services.
System.InvalidOperationException
HResult=0x80131509
Message=This service descriptor is keyed. Your service provider may not support keyed services.
Source=Microsoft.Extensions.DependencyInjection.Abstractions
StackTrace:
at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.ThrowKeyedDescriptor()
at Microsoft.Extensions.DependencyInjection.ServiceDescriptor.get_ImplementationType()
at Microsoft.Identity.Web.MicrosoftIdentityWebAppAuthenticationBuilderExtensions.<>c.<AddMicrosoftIdentityWebAppInternal>b__5_0(ServiceDescriptor s)
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable1 source, Func2 predicate, Boolean& found)
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at Microsoft.Identity.Web.MicrosoftIdentityWebAppAuthenticationBuilderExtensions.AddMicrosoftIdentityWebAppInternal(AuthenticationBuilder builder, Action1 configureMicrosoftIdentityOptions, Action1 configureCookieAuthenticationOptions, String openIdConnectScheme, String cookieScheme, Boolean subscribeToOpenIdConnectMiddlewareDiagnosticsEvents, String displayName)
at Microsoft.Identity.Web.MicrosoftIdentityWebAppAuthenticationBuilderExtensions.AddMicrosoftIdentityWebAppWithConfiguration(AuthenticationBuilder builder, Action1 configureMicrosoftIdentityOptions, Action1 configureCookieAuthenticationOptions, String openIdConnectScheme, String cookieScheme, Boolean subscribeToOpenIdConnectMiddlewareDiagnosticsEvents, String displayName, IConfigurationSection configurationSection)
at Microsoft.Identity.Web.MicrosoftIdentityWebAppAuthenticationBuilderExtensions.AddMicrosoftIdentityWebApp(AuthenticationBuilder builder, IConfigurationSection configurationSection, String openIdConnectScheme, String cookieScheme, Boolean subscribeToOpenIdConnectMiddlewareDiagnosticsEvents, String displayName)
at Program.<Main>$(String[] args) in C:\Users\v-elenafeng\source\repos\WebApplication9\WebApplication9\Program.cs:line 13
EXPECTED Can run successfully with MSI auth + Aspire enabled.
Try updating the identity packages. This is a bug that has been fixed.
Try updating the identity packages. This is a bug that has been fixed.
Thanks, after updating the identity packages I was able to run successfully. Just wondering when the package version fix in VS will come in? Is there a PR?
cc @vijayrkn @BillHiebert @phenning
@deepchoudhery - Can you please get the identity package versions updated in the identity scaffolding for this? This should just be a package update change.
Ping @deepchoudhery in case you didn't see this.
I'm able to repro this issue with the released VS 17.10.0.
@deepchoudhery ping you again on the packages update for msi to resolve this issue.
Hi, Will look at this issue in my next cycle here, apologies for the delay
This issue not repro on Dev17.11.0, and now the identity packages shows as below: