diff --git a/build/test-aot.ps1 b/build/test-aot.ps1 index 25fb24717..99e02bb5f 100644 --- a/build/test-aot.ps1 +++ b/build/test-aot.ps1 @@ -16,7 +16,7 @@ foreach ($line in $($publishOutput -split "`r`n")) } Write-Host "Actual warning count is: ", $actualWarningCount -$expectedWarningCount = 61 +$expectedWarningCount = 65 if ($LastExitCode -ne 0) { diff --git a/src/Microsoft.Identity.Web.DownstreamApi/DownstreamApiExtensions.cs b/src/Microsoft.Identity.Web.DownstreamApi/DownstreamApiExtensions.cs index df9c9effa..54b3b47b0 100644 --- a/src/Microsoft.Identity.Web.DownstreamApi/DownstreamApiExtensions.cs +++ b/src/Microsoft.Identity.Web.DownstreamApi/DownstreamApiExtensions.cs @@ -70,12 +70,15 @@ public static IServiceCollection AddDownstreamApis( _ = Throws.IfNull(services); Dictionary options = new(); - configurationSection.Bind(options); - - foreach (var optionsForService in options.Keys) - { - services.Configure(optionsForService, configurationSection.GetSection(optionsForService).Bind); - } + configurationSection.Bind(options); + + foreach (var optionsForService in options.Keys) + { + // lambda expression is needed as a workaround for IL2026 and IL3050 so the ConfigBinder Source Generator works + // https://github.com/dotnet/aspire/blob/2ed738cb524f7ce82490f0da33a1ea3e194011e8/src/Components/Aspire.Azure.Messaging.ServiceBus/AspireServiceBusExtensions.cs#L105 + IConfigurationSection optionsForServiceSection = configurationSection.GetSection(optionsForService); + services.Configure(optionsForService, bindOptions => optionsForServiceSection.Bind(bindOptions)); + } RegisterDownstreamApi(services); return services; } diff --git a/src/Microsoft.Identity.Web.DownstreamApi/Microsoft.Identity.Web.DownstreamApi.csproj b/src/Microsoft.Identity.Web.DownstreamApi/Microsoft.Identity.Web.DownstreamApi.csproj index ce13a395f..ba139f474 100644 --- a/src/Microsoft.Identity.Web.DownstreamApi/Microsoft.Identity.Web.DownstreamApi.csproj +++ b/src/Microsoft.Identity.Web.DownstreamApi/Microsoft.Identity.Web.DownstreamApi.csproj @@ -4,9 +4,11 @@ Microsoft Identity Web downstream API Interface for higher level API for confidential client applications. {A123BD94-812D-40EC-9576-1A7AB5C59913} - true README.md + + true + True