Order of IHostingStartup Configure calls (#6969)
parent
0e9e4a0c49
commit
197fd1c607
|
@ -51,7 +51,7 @@ A [HostingStartup](/dotnet/api/microsoft.aspnetcore.hosting.hostingstartupattrib
|
|||
|
||||
[!code-csharp[](platform-specific-configuration/snapshot_sample/StartupEnhancement.cs?name=snippet1)]
|
||||
|
||||
A class implements `IHostingStartup`. The class's [Configure](/dotnet/api/microsoft.aspnetcore.hosting.ihostingstartup.configure) method uses an [IWebHostBuilder](/dotnet/api/microsoft.aspnetcore.hosting.iwebhostbuilder) to add enhancements to an app:
|
||||
A class implements `IHostingStartup`. The class's [Configure](/dotnet/api/microsoft.aspnetcore.hosting.ihostingstartup.configure) method uses an [IWebHostBuilder](/dotnet/api/microsoft.aspnetcore.hosting.iwebhostbuilder) to add enhancements to an app. `IHostingStartup.Configure` in the hosting startup assembly is called by the runtime before `Startup.Configure` in user code, which allows user code to overwrite any configruation provided by the hosting startup assembly.
|
||||
|
||||
[!code-csharp[](platform-specific-configuration/snapshot_sample/StartupEnhancement.cs?name=snippet2&highlight=3,5)]
|
||||
|
||||
|
@ -111,13 +111,15 @@ The shared framework version reflects the version of the shared runtime that the
|
|||
|
||||
Set the following environment variables in the context of the app that uses the enhancement.
|
||||
|
||||
ASPNETCORE\_HOSTINGSTARTUPASSEMBLIES
|
||||
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES
|
||||
|
||||
Only hosting startup assemblies are scanned for the `HostingStartupAttribute`. The assembly name of the implementation is provided in this environment variable. The sample app sets this value to `StartupDiagnostics`.
|
||||
|
||||
The value can also be set using the [Hosting Startup Assemblies](xref:fundamentals/host/web-host#hosting-startup-assemblies) host configuration setting.
|
||||
|
||||
DOTNET\_ADDITIONAL\_DEPS
|
||||
When multiple hosting startup assembles are present, their [Configure](/dotnet/api/microsoft.aspnetcore.hosting.ihostingstartup.configure) methods are executed in the order that the assemblies are listed.
|
||||
|
||||
DOTNET_ADDITIONAL_DEPS
|
||||
|
||||
The location of the implementation's *\*.deps.json* file.
|
||||
|
||||
|
|
Loading…
Reference in New Issue