1 implementation of IHostingEnvironment
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
11
internal sealed class HostingEnvironment :
IHostingEnvironment
, Extensions.Hosting.IHostingEnvironment, IWebHostEnvironment
47 references to IHostingEnvironment
InProcessWebSite (4)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (4)
57
private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.
IHostingEnvironment
>().ContentRootPath);
59
private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.
IHostingEnvironment
>().WebRootPath);
177
var
hostingEnv = context.RequestServices.GetService<Microsoft.AspNetCore.Hosting.
IHostingEnvironment
>();
Microsoft.AspNetCore.Hosting (5)
GenericHost\GenericWebHostBuilder.cs (2)
60
services.AddSingleton((AspNetCore.Hosting.
IHostingEnvironment
)webhostContext.HostingEnvironment);
374
|| serviceType == typeof(Microsoft.AspNetCore.Hosting.
IHostingEnvironment
)
GenericHost\SlimWebHostBuilder.cs (1)
36
services.AddSingleton((AspNetCore.Hosting.
IHostingEnvironment
)webhostContext.HostingEnvironment);
Internal\HostingEnvironmentExtensions.cs (1)
12
internal static void Initialize(this
IHostingEnvironment
hostingEnvironment, string contentRootPath, WebHostOptions options)
WebHostBuilder.cs (1)
270
services.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>
17
public static bool IsDevelopment(this
IHostingEnvironment
hostingEnvironment)
27
/// <param name="hostingEnvironment">An instance of <see cref="
IHostingEnvironment
"/>.</param>
29
public static bool IsStaging(this
IHostingEnvironment
hostingEnvironment)
39
/// <param name="hostingEnvironment">An instance of <see cref="
IHostingEnvironment
"/>.</param>
41
public static bool IsProduction(this
IHostingEnvironment
hostingEnvironment)
51
/// <param name="hostingEnvironment">An instance of <see cref="
IHostingEnvironment
"/>.</param>
55
this
IHostingEnvironment
hostingEnvironment,
Microsoft.AspNetCore.Hosting.Tests (17)
WebHostBuilderTests.cs (9)
614
Assert.Equal(expected, host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>().EnvironmentName);
662
Assert.Equal("/", host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>().ContentRootPath);
680
var basePath2 = host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>().ContentRootPath;
703
Assert.Equal(appBase, host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>().ContentRootPath);
734
var
hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>();
752
var
hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>();
1684
var heDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(
IHostingEnvironment
));
WebHostTests.cs (8)
716
var
env2 = host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>();
803
var
env2 = host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>();
826
var
env2 = host.Services.GetService<AspNetCore.Hosting.
IHostingEnvironment
>();
852
var
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