1 implementation of IWebHostEnvironment
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
11internal sealed class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment, IWebHostEnvironment
135 references to IWebHostEnvironment
blazor-devserver (2)
Server\Startup.cs (2)
34var webHostEnvironment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore (10)
ConfigureWebHostBuilder.cs (1)
18private readonly IWebHostEnvironment _environment;
GenericHostBuilderExtensions.cs (2)
23/// <item><description>configure <see cref="IWebHostEnvironment.WebRootFileProvider"/> to include static web assets from projects referenced by the entry assembly during development</description></item> 48/// <item><description>configure <see cref="IWebHostEnvironment.WebRootFileProvider"/> to include static web assets from projects referenced by the entry assembly during development</description></item>
WebApplication.cs (4)
52/// The application's configured <see cref="IWebHostEnvironment"/>. 54public IWebHostEnvironment Environment => _host.Services.GetRequiredService<IWebHostEnvironment>(); 267public IWebHostEnvironment Environment => _webApplication.Environment;
WebApplicationBuilder.cs (1)
336public IWebHostEnvironment Environment { get; private set; }
WebHost.cs (2)
152/// configure the <see cref="IWebHostEnvironment.WebRootFileProvider"/> to map static web assets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 176var env = hostingContext.HostingEnvironment;
Microsoft.AspNetCore.Components.Endpoints (3)
DependencyInjection\DefaultRazorComponentsServiceOptionsConfiguration.cs (1)
17IWebHostEnvironment environment)
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
209var env = httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitOptionsJavaScriptInitializersConfiguration.cs (2)
12private readonly IWebHostEnvironment _environment; 14public CircuitOptionsJavaScriptInitializersConfiguration(IWebHostEnvironment environment)
Microsoft.AspNetCore.Components.WebAssembly.Server (9)
Builder\WebAssemblyRazorComponentsEndpointConventionBuilderExtensions.cs (2)
55var environment = endpointBuilder.ServiceProvider.GetRequiredService<IWebHostEnvironment>();
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
38var webHostEnvironment = builder.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
ContentEncodingNegotiator.cs (2)
25private readonly IWebHostEnvironment _webHostEnvironment; 27public ContentEncodingNegotiator(RequestDelegate next, IWebHostEnvironment webHostEnvironment)
DebugProxyLauncher.cs (3)
60var environment = serviceProvider.GetRequiredService<IWebHostEnvironment>(); 118private static string LocateDebugProxyExecutable(IWebHostEnvironment environment)
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (1)
33IWebHostEnvironment hostingEnvironment,
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
49IWebHostEnvironment hostingEnvironment,
Microsoft.AspNetCore.Hosting (13)
GenericHost\GenericWebHostBuilder.cs (1)
384|| serviceType == typeof(IWebHostEnvironment)
GenericHost\GenericWebHostService.cs (2)
29IWebHostEnvironment hostingEnvironment, 59public IWebHostEnvironment HostingEnvironment { get; }
Internal\HostingEnvironmentExtensions.cs (1)
61this IWebHostEnvironment hostingEnvironment,
StaticWebAssets\StaticWebAssetsLoader.cs (6)
20/// Configure the <see cref="IWebHostEnvironment"/> to use static web assets. 22/// <param name="environment">The application <see cref="IWebHostEnvironment"/>.</param> 24public static void UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration) 36internal static void UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest) 46internal static Stream? ResolveManifest(IWebHostEnvironment environment, IConfiguration configuration) 69private static string? ResolveRelativeToAssembly(IWebHostEnvironment environment)
WebHostBuilder.cs (2)
264((IWebHostEnvironment)_hostingEnvironment).Initialize(contentRootPath, _options); 269services.AddSingleton<IWebHostEnvironment>(_hostingEnvironment);
WebHostBuilderExtensions.cs (1)
247/// Configures the <see cref="IWebHostEnvironment.WebRootFileProvider"/> to use static web assets
Microsoft.AspNetCore.Hosting.Abstractions (2)
WebHostBuilderContext.cs (2)
14/// The <see cref="IWebHostEnvironment" /> initialized by the <see cref="IWebHost" />. 16public IWebHostEnvironment HostingEnvironment { get; set; } = default!;
Microsoft.AspNetCore.Http.Results (5)
Results.cs (1)
467/// <param name="path">The path to the file. When not rooted, resolves the path relative to <see cref="IWebHostEnvironment.WebRootFileProvider"/>.</param>
TypedResults.cs (2)
496/// <param name="path">The path to the file. When not rooted, resolves the path relative to <see cref="IWebHostEnvironment.WebRootFileProvider"/>.</param> 529/// <param name="path">The path to the file. When not rooted, resolves the path relative to <see cref="IWebHostEnvironment.WebRootFileProvider"/>.</param>
VirtualFileHttpResult.cs (2)
106var hostingEnvironment = httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.Identity.UI (6)
_generated\38\_Layout_cshtml.g.cs (1)
596IWebHostEnvironment
_generated\80\_Layout_cshtml.g.cs (1)
599IWebHostEnvironment
IdentityBuilderUIExtensions.cs (2)
71var environment = builder.Services.Where(d => d.ServiceType == typeof(IWebHostEnvironment)).ToArray(); 72var applicationName = ((IWebHostEnvironment?)environment.LastOrDefault()?.ImplementationInstance)
IdentityDefaultUIConfigureOptions.cs (2)
20IWebHostEnvironment environment) 25public IWebHostEnvironment Environment { get; }
Microsoft.AspNetCore.Mvc.Core (7)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (3)
51var environment = GetServiceFromCollection<IWebHostEnvironment>(services); 72private static ApplicationPartManager GetApplicationPartManager(IServiceCollection services, IWebHostEnvironment? environment)
Infrastructure\VirtualFileResultExecutor.cs (4)
18private readonly IWebHostEnvironment _hostingEnvironment; 25public VirtualFileResultExecutor(ILoggerFactory loggerFactory, IWebHostEnvironment hostingEnvironment) 105internal static IFileInfo GetFileInformation(VirtualFileResult result, IWebHostEnvironment hostingEnvironment) 123internal static IFileProvider GetFileProvider(VirtualFileResult result, IWebHostEnvironment hostingEnvironment)
Microsoft.AspNetCore.Mvc.Localization (2)
ViewLocalizer.cs (2)
27/// <param name="hostingEnvironment">The <see cref="IWebHostEnvironment"/>.</param> 28public ViewLocalizer(IHtmlLocalizerFactory localizerFactory, IWebHostEnvironment hostingEnvironment)
Microsoft.AspNetCore.Mvc.Razor (1)
Infrastructure\DefaultFileVersionProvider.cs (1)
22IWebHostEnvironment hostingEnvironment,
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (8)
CSharpCompiler.cs (4)
24private readonly IWebHostEnvironment _hostingEnvironment; 31public CSharpCompiler(RazorReferenceManager manager, IWebHostEnvironment hostingEnvironment) 163IWebHostEnvironment hostingEnvironment, 210IWebHostEnvironment hostingEnvironment,
DependencyInjection\MvcRazorRuntimeCompilationOptionsSetup.cs (2)
13private readonly IWebHostEnvironment _hostingEnvironment; 15public MvcRazorRuntimeCompilationOptionsSetup(IWebHostEnvironment hostingEnvironment)
FileProviderRazorProjectFileSystem.cs (2)
14private readonly IWebHostEnvironment _hostingEnvironment; 16public FileProviderRazorProjectFileSystem(RuntimeCompilationFileProvider fileProvider, IWebHostEnvironment hostingEnvironment)
Microsoft.AspNetCore.Mvc.TagHelpers (12)
EnvironmentTagHelper.cs (3)
24public EnvironmentTagHelper(IWebHostEnvironment hostingEnvironment) 62/// Gets the <see cref="IWebHostEnvironment"/> for the application. 64protected IWebHostEnvironment HostingEnvironment { get; }
ImageTagHelper.cs (3)
60IWebHostEnvironment hostingEnvironment, 94/// Gets the <see cref="IWebHostEnvironment"/> for the application. 98protected internal IWebHostEnvironment HostingEnvironment { get; }
LinkTagHelper.cs (3)
107IWebHostEnvironment hostingEnvironment, 211/// Gets the <see cref="IWebHostEnvironment"/> for the application. 213protected internal IWebHostEnvironment HostingEnvironment { get; }
ScriptTagHelper.cs (3)
98IWebHostEnvironment hostingEnvironment, 201/// Gets the <see cref="IWebHostEnvironment"/> for the application. 203protected internal IWebHostEnvironment HostingEnvironment { get; }
Microsoft.AspNetCore.Rewrite (3)
RewriteBuilderExtensions.cs (2)
57var webHostEnv = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
RewriteMiddleware.cs (1)
34IWebHostEnvironment hostingEnvironment,
Microsoft.AspNetCore.SpaServices.Extensions (5)
SpaDefaultPageMiddleware.cs (3)
58var hostEnvironment = (IWebHostEnvironment?)context.RequestServices.GetService(typeof(IWebHostEnvironment));
StaticFiles\DefaultSpaStaticFileProvider.cs (2)
30var env = serviceProvider.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.StaticAssets (14)
Development\StaticAssetDevelopmentRuntimeHandler.cs (5)
59var fileInfo = context.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootFileProvider.GetFileInfo(asset.AssetPath); 176var fileInfo = _context.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootFileProvider.GetFileInfo(_asset.AssetPath); 258IWebHostEnvironment environment, 398private sealed class FileExistsConstraint(IWebHostEnvironment environment) : IRouteConstraint 400private readonly IWebHostEnvironment _environment = environment;
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (2)
59var environment = services.GetRequiredService<IWebHostEnvironment>();
StaticAssetEndpointFactory.cs (1)
43var fileProvider = serviceProvider.GetRequiredService<IWebHostEnvironment>().WebRootFileProvider;
StaticAssetsEndpointRouteBuilderExtensions.cs (4)
30var environment = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>(); 91var environment = endpoints.ServiceProvider.GetRequiredService<IWebHostEnvironment>();
StaticAssetsInvoker.cs (2)
165var environment = context.RequestServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.StaticFiles (29)
DefaultFilesExtensions.cs (4)
22/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 23/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder. 39/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 40/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder.
DefaultFilesMiddleware.cs (2)
28/// <param name="hostingEnv">The <see cref="IWebHostEnvironment"/> used by this middleware.</param> 30public DefaultFilesMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<DefaultFilesOptions> options)
DirectoryBrowserExtensions.cs (4)
22/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 23/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder. 39/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 40/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder.
DirectoryBrowserMiddleware.cs (4)
28/// <param name="hostingEnv">The <see cref="IWebHostEnvironment"/> used by this middleware.</param> 30public DirectoryBrowserMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<DirectoryBrowserOptions> options) 39/// <param name="hostingEnv">The <see cref="IWebHostEnvironment"/> used by this middleware.</param> 42public DirectoryBrowserMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, HtmlEncoder encoder, IOptions<DirectoryBrowserOptions> options)
FileServerExtensions.cs (6)
21/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 22/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder. 38/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 39/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder. 58/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 59/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder.
Helpers.cs (1)
13internal static IFileProvider ResolveFileProvider(IWebHostEnvironment hostingEnv)
Infrastructure\SharedOptionsBase.cs (2)
45/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 46/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder.
StaticFileExtensions.cs (4)
22/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 23/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder. 39/// Files are served from the path specified in <see cref="IWebHostEnvironment.WebRootPath"/> 40/// or <see cref="IWebHostEnvironment.WebRootFileProvider"/> which defaults to the 'wwwroot' subfolder.
StaticFileMiddleware.cs (2)
29/// <param name="hostingEnv">The <see cref="IWebHostEnvironment"/> used by this middleware.</param> 32public StaticFileMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<StaticFileOptions> options, ILoggerFactory loggerFactory)