1 write to Environment
Microsoft.AspNetCore (1)
WebApplicationBuilder.cs (1)
213Environment = webHostContext.HostingEnvironment;
34 references to Environment
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (2)
203[MemberNotNull(nameof(Environment), nameof(Host), nameof(WebHost))] 372IHostEnvironment IHostApplicationBuilder.Environment => Environment;
Microsoft.AspNetCore.StaticAssets.Tests (1)
StaticAssetsIntegrationTests.cs (1)
597builder.Environment.WebRootFileProvider = new TestFileProvider(new TestResource[]
Microsoft.AspNetCore.Tests (30)
WebApplicationTests.cs (30)
516Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 517Assert.Equal(fullWebRootPath, builder.Environment.WebRootPath); 545Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 546Assert.Equal(fullWebRootPath, builder.Environment.WebRootPath); 587Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 588Assert.Equal(fullWebRootPath, builder.Environment.WebRootPath); 629Assert.Equal(NormalizePath(AppContext.BaseDirectory), NormalizePath(builder.Environment.ContentRootPath)); 653Assert.Equal(NormalizePath(Environment.CurrentDirectory), NormalizePath(builder.Environment.ContentRootPath)); 678Assert.Equal(NormalizePath(AppContext.BaseDirectory), NormalizePath(builder.Environment.ContentRootPath)); 816Assert.Equal(nameof(WebApplicationTests), builder.Environment.ApplicationName); 817Assert.Equal(envName, builder.Environment.EnvironmentName); 818Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 819Assert.Equal(fullWebRootPath, builder.Environment.WebRootPath); 865Assert.Equal(nameof(WebApplicationTests), builder.Environment.ApplicationName); 866Assert.Equal(envName, builder.Environment.EnvironmentName); 867Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 868Assert.Equal(fullWebRootPath, builder.Environment.WebRootPath); 911Assert.Equal(nameof(WebApplicationTests), builder.Environment.ApplicationName); 912Assert.Equal(envName, builder.Environment.EnvironmentName); 913Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 914Assert.Equal(fullWebRootPath, builder.Environment.WebRootPath); 940Assert.Equal(assemblyName, builder.Environment.ApplicationName); 982Assert.Equal(assemblyName, builder.Environment.ApplicationName); 1049Assert.Equal("Testing", builder.Environment.EnvironmentName); 2260Assert.Equal(builder.Environment.ApplicationName, hostEnv.ApplicationName); 2261Assert.Equal(builder.Environment.EnvironmentName, hostEnv.EnvironmentName); 2262Assert.Equal(builder.Environment.ContentRootPath, hostEnv.ContentRootPath); 2290Assert.Equal(builder.Environment.ApplicationName, hostEnv.ApplicationName); 2291Assert.Equal(builder.Environment.EnvironmentName, hostEnv.EnvironmentName); 2292Assert.Equal(builder.Environment.ContentRootPath, hostEnv.ContentRootPath);
Stress.ApiService (1)
Program.cs (1)
22b.AddService(builder.Environment.ApplicationName);