Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address FunctionsApplicationBuilder.Environment null #2837

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/DotNetWorker/Builder/FunctionsApplicationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,14 @@ internal FunctionsApplicationBuilder(string[]? args)
/// <inheritdoc/>
public IDictionary<object, object> Properties => ((IHostApplicationBuilder)_hostApplicationBuilder).Properties;

/// <inheritdoc/>
IConfigurationManager IHostApplicationBuilder.Configuration => Configuration;

/// <summary>
/// Gets the set of key/value configuration properties.
/// </summary>
/// <remarks>
/// This can be mutated by adding more configuration sources, which will update its current view.
/// </remarks>
/// <inheritdoc/>
public ConfigurationManager Configuration => _hostApplicationBuilder.Configuration;

/// <inheritdoc/>
public IHostEnvironment Environment { get; private set; }
public IHostEnvironment Environment => _bootstrapHostBuilder.Context.HostingEnvironment;

/// <inheritdoc/>
public ILoggingBuilder Logging => _hostApplicationBuilder.Logging;
Expand Down Expand Up @@ -134,7 +130,6 @@ private IFunctionsWorkerApplicationBuilder InitializeHosting(BootstrapHostBuilde
// Grab the HostBuilderContext from the property bag to use in the ConfigureWebHostBuilder. Then
// grab the IWebHostEnvironment from the webHostContext. This also matches the instance in the IServiceCollection.
//var hostContext = (HostBuilderContext)bootstrapHostBuilder.Properties[typeof(HostBuilderContext)];
Environment = bootstrapHostBuilder.Context.HostingEnvironment;

//Host = new ConfigureHostBuilder(bootstrapHostBuilder.Context, Configuration, Services);
//WebHost = new ConfigureWebHostBuilder(webHostContext, Configuration, Services);
Expand Down