1 implementation of IHostingEnvironment
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
11internal sealed class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment, IWebHostEnvironment
47 references to IHostingEnvironment
InProcessWebSite (4)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (4)
57private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 59private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().WebRootPath); 177var hostingEnv = context.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>();
Microsoft.AspNetCore.Hosting (5)
GenericHost\GenericWebHostBuilder.cs (2)
60services.AddSingleton((AspNetCore.Hosting.IHostingEnvironment)webhostContext.HostingEnvironment); 374|| serviceType == typeof(Microsoft.AspNetCore.Hosting.IHostingEnvironment)
GenericHost\SlimWebHostBuilder.cs (1)
36services.AddSingleton((AspNetCore.Hosting.IHostingEnvironment)webhostContext.HostingEnvironment);
Internal\HostingEnvironmentExtensions.cs (1)
12internal static void Initialize(this IHostingEnvironment hostingEnvironment, string contentRootPath, WebHostOptions options)
WebHostBuilder.cs (1)
270services.AddSingleton<AspNetCore.Hosting.IHostingEnvironment>(_hostingEnvironment);
Microsoft.AspNetCore.Hosting.Abstractions (9)
HostingEnvironmentExtensions.cs (9)
8/// Extension methods for <see cref="IHostingEnvironment"/>. 15/// <param name="hostingEnvironment">An instance of <see cref="IHostingEnvironment"/>.</param> 17public static bool IsDevelopment(this IHostingEnvironment hostingEnvironment) 27/// <param name="hostingEnvironment">An instance of <see cref="IHostingEnvironment"/>.</param> 29public static bool IsStaging(this IHostingEnvironment hostingEnvironment) 39/// <param name="hostingEnvironment">An instance of <see cref="IHostingEnvironment"/>.</param> 41public static bool IsProduction(this IHostingEnvironment hostingEnvironment) 51/// <param name="hostingEnvironment">An instance of <see cref="IHostingEnvironment"/>.</param> 55this IHostingEnvironment hostingEnvironment,
Microsoft.AspNetCore.Hosting.Tests (17)
WebHostBuilderTests.cs (9)
614Assert.Equal(expected, host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().EnvironmentName); 662Assert.Equal("/", host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 680var basePath2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath; 703Assert.Equal(appBase, host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); 734var hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 752var hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 1684var heDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(IHostingEnvironment));
WebHostTests.cs (8)
716var env2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 803var env2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 826var env2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>(); 852var env1 = host.Services.GetService<IHostingEnvironment>();
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
MvcRazorRuntimeCompilationOptions.cs (1)
20/// <see cref="IHostingEnvironment.ContentRootFileProvider"/> that is rooted at the application root.
Microsoft.AspNetCore.Mvc.RazorPages (1)
DependencyInjection\MvcRazorPagesMvcBuilderExtensions.cs (1)
53/// Configures Razor Pages to be rooted at the content root (<see cref="IHostingEnvironment.ContentRootPath"/>).
Microsoft.AspNetCore.Mvc.TagHelpers (8)
EnvironmentTagHelper.cs (5)
12/// content based on the current value of <see cref="IHostingEnvironment.EnvironmentName"/>. 23/// <param name="hostingEnvironment">The <see cref="IHostingEnvironment"/>.</param> 38/// <see cref="IHostingEnvironment.EnvironmentName"/>. 48/// <see cref="IHostingEnvironment.EnvironmentName"/>. 57/// <see cref="IHostingEnvironment.EnvironmentName"/>.
ImageTagHelper.cs (1)
53/// <param name="hostingEnvironment">The <see cref="IHostingEnvironment"/>.</param>
LinkTagHelper.cs (1)
98/// <param name="hostingEnvironment">The <see cref="IHostingEnvironment"/>.</param>
ScriptTagHelper.cs (1)
89/// <param name="hostingEnvironment">The <see cref="IHostingEnvironment"/>.</param>
Microsoft.AspNetCore.Rewrite (1)
RewriteOptions.cs (1)
24/// Defaults to <see cref="IHostingEnvironment.WebRootFileProvider"/>.
Microsoft.AspNetCore.SpaServices.Extensions (1)
SpaOptions.cs (1)
58/// <see cref="IHostingEnvironment.WebRootPath"/>, which by default is