Skip to content

Commit

Permalink
Merging internal commits for release/6.0 (#41156)
Browse files Browse the repository at this point in the history
* [internal/release/6.0] Update dependencies from dnceng/internal/dotnet-efcore

* [internal/release/6.0] Update dependencies from dnceng/internal/dotnet-efcore

* [internal/release/6.0] Update dependencies from dnceng/internal/dotnet-efcore

* [internal/release/6.0] Update dependencies from dnceng/internal/dotnet-runtime

* Merged PR 21649: [internal/release/6.0] Make UseUrls() override default hosting config

## Description

Prior to this change, default config (typically loaded from `DOTNET_`/`ASPNET_` environment variables and command line arguments) could override the application-level configuration. This would prevent `GenericWebHostService` from seeing the latest configuration set by `UseUrls()` of `DOTNET_URLS`, `ASPNET_URLS` or `--urls` was set.

Fixes #38185

## Customer Impact

This is a big gotcha to customers using `WebApplicationBuilder` (which is used in all the ASP.NET Core 6 templates) who expect the following to work:

```C#
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseUrls("http://*:8080");
var app = builder.Build();
app.Run();
```

A comment on the issue suggesting we patch this has gotten 5 thumbs ups not counting mine.

## Regression?

- [ ] Yes
- [x] No

## Risk

- [ ] High
- [ ] Medium
- [x] Low

This is a small well tested change which only affects the loading of default config sources and those added via a `HostFactoryResolver` to host configuration. [Here’s the existing test](https://github.com/dotnet/aspnetcore/blob/0f6f649f1da658bbe37b8898df0c80c5affa9d2d/src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebApplicationTests.cs#L883) showing that the expected configuration providers are still dispose.

## Verification

- [x] Manual (required)
- [x] Automated

## Packaging changes reviewed?

- [ ] Yes
- [ ] No
- [x] N/A

* [internal/release/6.0] Update dependencies from dnceng/internal/dotnet-runtime

* Merge from github release/6.0

* [internal/release/6.0] Update dependencies from dnceng/internal/dotnet-efcore dnceng/internal/dotnet-runtime

 - Set to private runtime

* Merged PR 21869: Correct `--architecture` in `fpm` commands

# {PR title}

Correct `--architecture` in `fpm` commands

## Description

Update `fpm` commands to use a supported `--architecture` value. As-is, the x64 .rpm files we produce are incompatible w/ installation on an x64 machine. Problem found during servicing version flow.

## Customer Impact

Unable to build dotnet-installer-ci-official w/ current .rpm files from dotnet-aspnetcore repo.

## Regression?

- [x] Yes
- [ ] No

This is a build regression since 6.0.3. It will also impact our 'main' branch.

## Risk

- [ ] High
- [ ] Medium
- [x] Low

Have verified the chosen values for the command line using available online documentation. Since we know the current .rpm files are busted, things can only get better 😃

## Verification

- [x] Manual (required)
- [ ] Automated

I am locally building this branch and will use `rpmlint` in a `docker` container to verify the goodness of the produced package.

## Packaging changes reviewed?

- [ ] Yes
- [ ] No
- [ ] N/A

Not sure how to answer this because the change is to an internal setting of the RPM installer. If others agree it's the right change, it's been reviewed 😃

----

## When servicing release/2.1

- [ ] Make necessary changes in eng/PatchConfig.props

* Merged PR 21931: Revert "[release/6.0] Build ProjectTemplates in Source-Build (#40650)" (#40805)

# {PR title}

Summary of the changes (Less than 80 chars)

## Description

{Detail}

Fixes #{bug number} (in this specific format)

## Customer Impact

{Justification}

## Regression?

- [ ] Yes
- [ ] No

[If yes, specify the version the behavior has regressed from]

## Risk

- [ ] High
- [ ] Medium
- [ ] Low

[Justify the selection above]

## Verification

- [ ] Manual (required)
- [ ] Automated

## Packaging changes reviewed?

- [ ] Yes
- [ ] No
- [ ] N/A

----

## When servicing release/2.1

- [ ] Make necessary changes in eng/PatchConfig.props

Revert "[release/6.0] Build ProjectTemplates in Source-Build (#40650)" (#40805)

This reverts commit 7c2000d.

Co-authored-by: dotnet-bot <dotnet-bot@microsoft.com>
Co-authored-by: DotNet Bot <dn-bot@microsoft.com>
Co-authored-by: Stephen Halter <shalter@microsoft.com>
Co-authored-by: mmitche <mmitche@microsoft.com>
Co-authored-by: Doug Bunting (AAPT) <dougbu@microsoft.com>
  • Loading branch information
5 people committed Apr 13, 2022
2 parents e71384f + d687378 commit 0d1fbec
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 61 deletions.
4 changes: 4 additions & 0 deletions NuGet.config
Expand Up @@ -4,8 +4,10 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-int-dotnet-runtime-be98e88" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-be98e88c/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-runtime -->
<!-- Begin: Package sources from dotnet-efcore -->
<add key="darc-int-dotnet-efcore-aca50ae" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-aca50aef/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-efcore -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
Expand All @@ -25,8 +27,10 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-efcore -->
<add key="darc-int-dotnet-efcore-aca50ae" value="true" />
<!-- End: Package sources from dotnet-efcore -->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-int-dotnet-runtime-be98e88" value="true" />
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
</disabledPackageSources>
Expand Down
74 changes: 37 additions & 37 deletions eng/Version.Details.xml
Expand Up @@ -9,37 +9,37 @@
-->
<Dependencies>
<ProductDependencies>
<Dependency Name="dotnet-ef" Version="6.0.3">
<Dependency Name="dotnet-ef" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="6.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>0257e5c118d78ce1b4d5e514779240c929c4b8aa</Sha>
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down Expand Up @@ -177,9 +177,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
</Dependency>
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="6.0.3-servicing.22123.9">
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="6.0.4-servicing.22164.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="System.Diagnostics.DiagnosticSource" Version="6.0.0">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand All @@ -201,9 +201,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
</Dependency>
<Dependency Name="System.Net.Http.WinHttpHandler" Version="6.0.0">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
<Dependency Name="System.Net.Http.WinHttpHandler" Version="6.0.1">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="System.Reflection.Metadata" Version="6.0.1">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
Expand Down Expand Up @@ -233,9 +233,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
</Dependency>
<Dependency Name="System.Text.Json" Version="6.0.2">
<Dependency Name="System.Text.Json" Version="6.0.3">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>839cdfb0ecca5e0be3dbccd926e7651ef50fdf10</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="System.Threading.Channels" Version="6.0.0">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand All @@ -245,40 +245,40 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.3">
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="6.0.3">
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="6.0.3">
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<!--
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
All Runtime.$rid packages should have the same version.
-->
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="6.0.3">
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="6.0.3">
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="6.0.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="6.0.3-servicing.22123.9">
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="6.0.4-servicing.22164.4">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
<Dependency Name="Microsoft.NETCore.Platforms" Version="6.0.2">
<Dependency Name="Microsoft.NETCore.Platforms" Version="6.0.3">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22206.7">
<Uri>https://github.com/dotnet/arcade</Uri>
Expand Down
36 changes: 18 additions & 18 deletions eng/Versions.props
Expand Up @@ -63,12 +63,12 @@
<PropertyGroup Label="Automated">
<!-- Packages from dotnet/runtime -->
<MicrosoftExtensionsDependencyModelVersion>6.0.0</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftNETCoreAppRefVersion>6.0.3</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.3</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>6.0.3</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
<MicrosoftNETRuntimeWebAssemblySdkVersion>6.0.3</MicrosoftNETRuntimeWebAssemblySdkVersion>
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>6.0.3</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
<MicrosoftNETCoreBrowserDebugHostTransportVersion>6.0.3-servicing.22123.9</MicrosoftNETCoreBrowserDebugHostTransportVersion>
<MicrosoftNETCoreAppRefVersion>6.0.4</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.4</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>6.0.4</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
<MicrosoftNETRuntimeWebAssemblySdkVersion>6.0.4</MicrosoftNETRuntimeWebAssemblySdkVersion>
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>6.0.4</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
<MicrosoftNETCoreBrowserDebugHostTransportVersion>6.0.4-servicing.22164.4</MicrosoftNETCoreBrowserDebugHostTransportVersion>
<MicrosoftExtensionsCachingAbstractionsVersion>6.0.0</MicrosoftExtensionsCachingAbstractionsVersion>
<MicrosoftExtensionsCachingMemoryVersion>6.0.1</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsConfigurationAbstractionsVersion>6.0.0</MicrosoftExtensionsConfigurationAbstractionsVersion>
Expand Down Expand Up @@ -103,33 +103,33 @@
<MicrosoftExtensionsOptionsDataAnnotationsVersion>6.0.0</MicrosoftExtensionsOptionsDataAnnotationsVersion>
<MicrosoftExtensionsOptionsVersion>6.0.0</MicrosoftExtensionsOptionsVersion>
<MicrosoftExtensionsPrimitivesVersion>6.0.0</MicrosoftExtensionsPrimitivesVersion>
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>6.0.3-servicing.22123.9</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>6.0.4-servicing.22164.4</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
<SystemDiagnosticsDiagnosticSourceVersion>6.0.0</SystemDiagnosticsDiagnosticSourceVersion>
<SystemDiagnosticsEventLogVersion>6.0.0</SystemDiagnosticsEventLogVersion>
<SystemDirectoryServicesProtocolsVersion>6.0.1</SystemDirectoryServicesProtocolsVersion>
<SystemIOPipelinesVersion>6.0.2</SystemIOPipelinesVersion>
<SystemNetHttpJsonVersion>6.0.0</SystemNetHttpJsonVersion>
<SystemNetHttpWinHttpHandlerVersion>6.0.0</SystemNetHttpWinHttpHandlerVersion>
<SystemNetHttpWinHttpHandlerVersion>6.0.1</SystemNetHttpWinHttpHandlerVersion>
<SystemReflectionMetadataVersion>6.0.1</SystemReflectionMetadataVersion>
<SystemResourcesExtensionsVersion>6.0.0</SystemResourcesExtensionsVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<SystemSecurityCryptographyPkcsVersion>6.0.0</SystemSecurityCryptographyPkcsVersion>
<SystemSecurityCryptographyXmlVersion>6.0.0</SystemSecurityCryptographyXmlVersion>
<SystemServiceProcessServiceControllerVersion>6.0.0</SystemServiceProcessServiceControllerVersion>
<SystemTextEncodingsWebVersion>6.0.0</SystemTextEncodingsWebVersion>
<SystemTextJsonVersion>6.0.2</SystemTextJsonVersion>
<SystemTextJsonVersion>6.0.3</SystemTextJsonVersion>
<SystemThreadingChannelsVersion>6.0.0</SystemThreadingChannelsVersion>
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
<MicrosoftNETCorePlatformsVersion>6.0.2</MicrosoftNETCorePlatformsVersion>
<MicrosoftNETCorePlatformsVersion>6.0.3</MicrosoftNETCorePlatformsVersion>
<!-- Packages from dotnet/efcore -->
<dotnetefVersion>6.0.3</dotnetefVersion>
<MicrosoftEntityFrameworkCoreInMemoryVersion>6.0.3</MicrosoftEntityFrameworkCoreInMemoryVersion>
<MicrosoftEntityFrameworkCoreRelationalVersion>6.0.3</MicrosoftEntityFrameworkCoreRelationalVersion>
<MicrosoftEntityFrameworkCoreSqliteVersion>6.0.3</MicrosoftEntityFrameworkCoreSqliteVersion>
<MicrosoftEntityFrameworkCoreSqlServerVersion>6.0.3</MicrosoftEntityFrameworkCoreSqlServerVersion>
<MicrosoftEntityFrameworkCoreToolsVersion>6.0.3</MicrosoftEntityFrameworkCoreToolsVersion>
<MicrosoftEntityFrameworkCoreVersion>6.0.3</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>6.0.3</MicrosoftEntityFrameworkCoreDesignVersion>
<dotnetefVersion>6.0.4</dotnetefVersion>
<MicrosoftEntityFrameworkCoreInMemoryVersion>6.0.4</MicrosoftEntityFrameworkCoreInMemoryVersion>
<MicrosoftEntityFrameworkCoreRelationalVersion>6.0.4</MicrosoftEntityFrameworkCoreRelationalVersion>
<MicrosoftEntityFrameworkCoreSqliteVersion>6.0.4</MicrosoftEntityFrameworkCoreSqliteVersion>
<MicrosoftEntityFrameworkCoreSqlServerVersion>6.0.4</MicrosoftEntityFrameworkCoreSqlServerVersion>
<MicrosoftEntityFrameworkCoreToolsVersion>6.0.4</MicrosoftEntityFrameworkCoreToolsVersion>
<MicrosoftEntityFrameworkCoreVersion>6.0.4</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>6.0.4</MicrosoftEntityFrameworkCoreDesignVersion>
<!-- Packages from dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.22206.7</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>6.0.0-beta.22206.7</MicrosoftDotNetBuildTasksTemplatingVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/helix/helix.proj
Expand Up @@ -10,7 +10,7 @@
not HelixCorrelationPayload.
-->
<PropertyGroup>
<IsPublicRuntime>true</IsPublicRuntime>
<IsPublicRuntime>false</IsPublicRuntime>
</PropertyGroup>

<PropertyGroup>
Expand Down
21 changes: 17 additions & 4 deletions src/DefaultBuilder/src/WebApplicationBuilder.cs
Expand Up @@ -22,6 +22,7 @@ public sealed class WebApplicationBuilder
private readonly BootstrapHostBuilder _bootstrapHostBuilder;
private readonly WebApplicationServiceCollection _services = new();
private readonly List<KeyValuePair<string, string>> _hostConfigurationValues;
private readonly ConfigurationManager _hostConfigurationManager = new();

private WebApplication? _builtApplication;

Expand Down Expand Up @@ -76,6 +77,8 @@ internal WebApplicationBuilder(WebApplicationOptions options, Action<IHostBuilde
});

Configuration = new();
// This is chained as the first configuration source in Configuration so host config can be added later without overriding app config.
Configuration.AddConfiguration(_hostConfigurationManager);

// Collect the hosted services separately since we want those to run after the user's hosted services
_services.TrackHostedServices = true;
Expand Down Expand Up @@ -194,22 +197,32 @@ public WebApplication Build()
// to the new one. This allows code that has references to the service collection to still function.
_services.InnerCollection = services;
// Keep any configuration sources added before the TrackingChainedConfigurationSource (namely host configuration from _hostConfigurationValues)
// from overriding config values set via Configuration by inserting them at beginning using _hostConfigurationValues.
var beforeChainedConfig = true;
var hostBuilderProviders = ((IConfigurationRoot)context.Configuration).Providers;
if (!hostBuilderProviders.Contains(chainedConfigSource.BuiltProvider))
{
// Something removed the _hostBuilder's TrackingChainedConfigurationSource pointing back to the ConfigurationManager.
// This is likely a test using WebApplicationFactory. Replicate the effect by clearing the ConfingurationManager sources.
((IConfigurationBuilder)Configuration).Sources.Clear();
beforeChainedConfig = false;
}
// Make builder.Configuration match the final configuration. To do that, we add the additional
// providers in the inner _hostBuilders's Configuration to the ConfigurationManager.
// Make the ConfigurationManager match the final _hostBuilder's configuration. To do that, we add the additional providers
// to the inner _hostBuilders's configuration to the ConfigurationManager. We wrap the existing provider in a
// configuration source to avoid rebuilding or reloading the already added configuration sources.
foreach (var provider in hostBuilderProviders)
{
if (!ReferenceEquals(provider, chainedConfigSource.BuiltProvider))
if (ReferenceEquals(provider, chainedConfigSource.BuiltProvider))
{
((IConfigurationBuilder)Configuration).Add(new ConfigurationProviderSource(provider));
beforeChainedConfig = false;
}
else
{
IConfigurationBuilder configBuilder = beforeChainedConfig ? _hostConfigurationManager : Configuration;
configBuilder.Add(new ConfigurationProviderSource(provider));
}
}
});
Expand Down

0 comments on commit 0d1fbec

Please sign in to comment.