2 writes to HostingEnvironment
Microsoft.Extensions.Hosting (2)
HostApplicationBuilder.cs (1)
170HostingEnvironment = hostingEnvironment,
HostBuilder.cs (1)
271HostingEnvironment = _hostingEnvironment!,
28 references to HostingEnvironment
Kestrel.SampleApp (1)
Startup.cs (1)
179var env = hostingContext.HostingEnvironment;
Microsoft.AspNetCore (1)
ConfigureHostBuilder.cs (1)
66var previousContentRoot = HostingPathResolver.ResolvePath(_context.HostingEnvironment.ContentRootPath);
Microsoft.AspNetCore.Hosting (7)
GenericHost\GenericWebHostBuilder.cs (4)
230if (StartupLoader.HasConfigureServicesIServiceProviderDelegate(startupType, context.HostingEnvironment.EnvironmentName)) 239var configureServicesBuilder = StartupLoader.FindConfigureServicesDelegate(startupType, context.HostingEnvironment.EnvironmentName); 246var configureContainerBuilder = StartupLoader.FindConfigureContainerDelegate(startupType, context.HostingEnvironment.EnvironmentName); 256configureBuilder = StartupLoader.FindConfigureDelegate(startupType, context.HostingEnvironment.EnvironmentName);
GenericHost\WebHostBuilderBase.cs (3)
79var options = new WebHostOptions(context.Configuration, fallbackConfiguration: _config, environment: context.HostingEnvironment); 85webHostBuilderContext.HostingEnvironment.Initialize(context.HostingEnvironment.ContentRootPath, options, baseEnvironment: context.HostingEnvironment);
Microsoft.AspNetCore.Tests (14)
WebApplicationTests.cs (14)
808Assert.Equal(nameof(WebApplicationTests), context.HostingEnvironment.ApplicationName); 809Assert.Equal(envName, context.HostingEnvironment.EnvironmentName); 810Assert.Equal(contentRoot, context.HostingEnvironment.ContentRootPath); 857Assert.Equal(nameof(WebApplicationTests), context.HostingEnvironment.ApplicationName); 858Assert.Equal(envName, context.HostingEnvironment.EnvironmentName); 859Assert.Equal(contentRoot, context.HostingEnvironment.ContentRootPath); 903Assert.Equal(nameof(WebApplicationTests), context.HostingEnvironment.ApplicationName); 904Assert.Equal(envName, context.HostingEnvironment.EnvironmentName); 905Assert.Equal(contentRoot, context.HostingEnvironment.ContentRootPath); 934Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 941Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 976Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 983Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 1056Assert.Equal("Testing", context.HostingEnvironment.EnvironmentName);
Microsoft.Extensions.AmbientMetadata.Application (1)
ApplicationMetadataHostBuilderExtensions.cs (1)
32.ConfigureAppConfiguration((hostBuilderContext, configurationBuilder) => configurationBuilder.AddApplicationMetadata(hostBuilderContext.HostingEnvironment, sectionName))
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
279string previousContentRootPath = _hostApplicationBuilder._hostBuilderContext.HostingEnvironment.ContentRootPath;
HostBuilder.cs (1)
351if (_hostBuilderContext!.HostingEnvironment.IsDevelopment() && _defaultProviderFactoryUsed)
HostingHostBuilderExtensions.cs (2)
238IHostEnvironment env = hostingContext.HostingEnvironment; 327bool isDevelopment = context.HostingEnvironment.IsDevelopment();