10 implementations of IWebHostEnvironment
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
287private class TestWebHostEnvironment : IWebHostEnvironment
HotReloadServiceTests.cs (1)
274private class TestWebHostEnvironment : IWebHostEnvironment
RazorComponentEndpointDataSourceTest.cs (1)
290private class TestWebHostEnvironment : IWebHostEnvironment
RazorComponentEndpointInvokerTest.cs (1)
54private class TestWebHostEnvironment : IWebHostEnvironment
RazorComponentsServiceCollectionExtensionsTest.cs (1)
139private class TestWebHostEnvironment : IWebHostEnvironment
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Infrastructure\TestWebHostEnvironment.cs (1)
9internal class TestWebHostEnvironment : IWebHostEnvironment
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
11internal sealed class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment, IWebHostEnvironment
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
259private class TestWebHostEnvironment : IWebHostEnvironment
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
335private class TestWebHostEnvironment : IWebHostEnvironment
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaServicesExtensionsTests.cs (1)
101private class TestWebHostEnvironment : IWebHostEnvironment
360 references to IWebHostEnvironment
blazor-devserver (2)
Server\Startup.cs (2)
33var webHostEnvironment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
BlazorServerApp (1)
Startup.cs (1)
27public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Certificate.Optional.Sample (1)
Startup.cs (1)
38public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Certificate.Sample (1)
Startup.cs (1)
41public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
ClaimsTransformation (1)
Startup.cs (1)
41public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Cookies (1)
Startup.cs (1)
48public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
CreateDefaultBuilderApp (2)
Program.cs (2)
33var hostingEnvironment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
CustomAuthorizationFailureResponse (1)
Startup.cs (1)
54public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
CustomPolicyProvider (1)
Startup.cs (1)
37public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
DynamicSchemes (1)
Startup.cs (1)
35public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
FilesWebSite (2)
Controllers\DownloadFilesController.cs (2)
12private readonly IWebHostEnvironment _hostingEnvironment; 15public DownloadFilesController(IWebHostEnvironment hostingEnvironment)
HeaderPropagationSample (1)
Startup.cs (1)
50public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHttpClientFactory clientFactory)
HostedBlazorWebassemblyApp.Server (1)
Startup.cs (1)
37public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
HostFilteringSample (1)
Program.cs (1)
26var env = hostingContext.HostingEnvironment;
HttpLogging.Sample (1)
Startup.cs (1)
22public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
HttpsPolicySample (1)
Startup.cs (1)
28public void Configure(IApplicationBuilder app, IWebHostEnvironment environment)
Identity.DefaultUI.WebSite (4)
NoIdentityStartup.cs (1)
39public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
StartupBase.cs (2)
53public virtual void Configure(IApplicationBuilder app, IWebHostEnvironment env) 85public static void DisableFilePolling(IWebHostEnvironment env)
StartupWithoutEndpointRouting.cs (1)
23public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Identity.ExternalClaims (1)
Startup.cs (1)
76public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
IdentitySample.DefaultUI (2)
Startup.cs (2)
21public Startup(IWebHostEnvironment env) 53public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
IdentitySample.Mvc (2)
Startup.cs (2)
14public Startup(IWebHostEnvironment env) 58public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
Logging.W3C.Sample (1)
Startup.cs (1)
25public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
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)
332public IWebHostEnvironment Environment { get; private set; }
WebHost.cs (2)
148/// configure the <see cref="IWebHostEnvironment.WebRootFileProvider"/> to map static web assets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 170var env = hostingContext.HostingEnvironment;
Microsoft.AspNetCore.Components.Endpoints (3)
DependencyInjection\DefaultRazorComponentsServiceOptionsConfiguration.cs (1)
17IWebHostEnvironment environment)
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
206var env = httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.Components.Endpoints.Tests (9)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
275collection.AddSingleton<IWebHostEnvironment>(new TestWebHostEnvironment());
HotReloadServiceTests.cs (1)
223services.AddSingleton<IWebHostEnvironment, TestWebHostEnvironment>();
RazorComponentEndpointDataSourceTest.cs (1)
226services.AddSingleton<IWebHostEnvironment, TestWebHostEnvironment>();
RazorComponentEndpointInvokerTest.cs (1)
24.AddSingleton<IWebHostEnvironment>(new TestWebHostEnvironment())
RazorComponentResultTest.cs (3)
453var mockWebHostEnvironment = Mock.Of<IWebHostEnvironment>( 458.AddSingleton<IWebHostEnvironment>(mockWebHostEnvironment)
RazorComponentsServiceCollectionExtensionsTest.cs (2)
21services.AddSingleton<IWebHostEnvironment>(new TestWebHostEnvironment()); 48services.AddSingleton<IWebHostEnvironment>(new TestWebHostEnvironment());
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitOptionsJavaScriptInitializersConfiguration.cs (2)
12private readonly IWebHostEnvironment _environment; 14public CircuitOptionsJavaScriptInitializersConfiguration(IWebHostEnvironment environment)
Microsoft.AspNetCore.Components.Server.Tests (1)
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
127var environment = new Mock<IWebHostEnvironment>();
Microsoft.AspNetCore.Components.WebAssembly.Server (10)
Builder\WebAssemblyRazorComponentsEndpointConventionBuilderExtensions.cs (2)
55var environment = endpointBuilder.ServiceProvider.GetRequiredService<IWebHostEnvironment>();
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
38var webHostEnvironment = builder.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
ComponentWebAssemblyConventions.cs (1)
19IWebHostEnvironment webHostEnvironment)
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.Components.WebAssembly.Server.Tests (2)
ContentEncodingNegotiatorTests.cs (2)
213private static IWebHostEnvironment CreateWebHostEnvironment(bool gzipExists = true, bool brotliExists = true) 223var env = new Mock<IWebHostEnvironment>();
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (1)
33IWebHostEnvironment hostingEnvironment,
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
49IWebHostEnvironment hostingEnvironment,
Microsoft.AspNetCore.Grpc.Swagger.Tests (3)
GrpcSwaggerServiceExtensionsTests.cs (2)
30services.AddSingleton<IWebHostEnvironment, TestWebHostEnvironment>(); 66services.AddSingleton<IWebHostEnvironment, TestWebHostEnvironment>();
Infrastructure\OpenApiTestHelpers.cs (1)
30services.AddSingleton<IWebHostEnvironment, TestWebHostEnvironment>();
Microsoft.AspNetCore.Hosting (13)
GenericHost\GenericWebHostBuilder.cs (1)
376|| 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)
262((IWebHostEnvironment)_hostingEnvironment).Initialize(contentRootPath, _options); 267services.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.Hosting.Tests (9)
HostingEnvironmentExtensionsTests.cs (4)
15IWebHostEnvironment env = new HostingEnvironment(); 35IWebHostEnvironment env = new HostingEnvironment(); 48IWebHostEnvironment env = new HostingEnvironment(); 61IWebHostEnvironment env = new HostingEnvironment();
WebHostBuilderTests.cs (3)
612Assert.Equal(expected, host.Services.GetService<IWebHostEnvironment>().EnvironmentName); 660Assert.Equal("/", host.Services.GetService<IWebHostEnvironment>().ContentRootPath); 1688var wheDescriptor = services.SingleOrDefault(s => s.ServiceType == typeof(IWebHostEnvironment));
WebHostTests.cs (2)
847var env = host.Services.GetService<IWebHostEnvironment>();
Microsoft.AspNetCore.Http.Results (5)
Results.cs (1)
466/// <param name="path">The path to the file. When not rooted, resolves the path relative to <see cref="IWebHostEnvironment.WebRootFileProvider"/>.</param>
TypedResults.cs (2)
495/// <param name="path">The path to the file. When not rooted, resolves the path relative to <see cref="IWebHostEnvironment.WebRootFileProvider"/>.</param> 528/// <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.Http.Results.Tests (12)
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (12)
46var appEnvironment = new Mock<IWebHostEnvironment>(); 83var appEnvironment = new Mock<IWebHostEnvironment>(); 120var appEnvironment = new Mock<IWebHostEnvironment>(); 153var appEnvironment = new Mock<IWebHostEnvironment>(); 189var appEnvironment = new Mock<IWebHostEnvironment>(); 223var appEnvironment = new Mock<IWebHostEnvironment>(); 259var appEnvironment = new Mock<IWebHostEnvironment>(); 290var appEnvironment = new Mock<IWebHostEnvironment>(); 329var appEnvironment = new Mock<IWebHostEnvironment>(); 489var hostingEnvironment = Mock.Of<IWebHostEnvironment>(e => e.WebRootFileProvider == webRootFileProvider); 491services.AddSingleton<IWebHostEnvironment>(hostingEnvironment);
Microsoft.AspNetCore.Identity.UI (4)
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.Core.Test (29)
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (8)
151var environment = new Mock<IWebHostEnvironment>(); 153services.AddSingleton<IWebHostEnvironment>(environment.Object); 172var environment = new Mock<IWebHostEnvironment>(); 173services.AddSingleton<IWebHostEnvironment>(environment.Object); 175environment = new Mock<IWebHostEnvironment>(); 177services.AddSingleton<IWebHostEnvironment>(environment.Object); 195var environment = new Mock<IWebHostEnvironment>(); 199services.AddSingleton<IWebHostEnvironment>(environment.Object);
Filters\MiddlewareFilterConfigurationProviderTest.cs (3)
50services.AddSingleton(Mock.Of<IWebHostEnvironment>()); 118IWebHostEnvironment hostingEnvironment, 135IWebHostEnvironment hostingEnvironment,
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (12)
46var appEnvironment = new Mock<IWebHostEnvironment>(); 83var appEnvironment = new Mock<IWebHostEnvironment>(); 120var appEnvironment = new Mock<IWebHostEnvironment>(); 153var appEnvironment = new Mock<IWebHostEnvironment>(); 189var appEnvironment = new Mock<IWebHostEnvironment>(); 223var appEnvironment = new Mock<IWebHostEnvironment>(); 259var appEnvironment = new Mock<IWebHostEnvironment>(); 290var appEnvironment = new Mock<IWebHostEnvironment>(); 329var appEnvironment = new Mock<IWebHostEnvironment>(); 489var hostingEnvironment = Mock.Of<IWebHostEnvironment>(e => e.WebRootFileProvider == webRootFileProvider); 491services.AddSingleton<IWebHostEnvironment>(hostingEnvironment);
VirtualFileResultTest.cs (6)
53var webHostEnvironment = Mock.Of<IWebHostEnvironment>(e => e.WebRootFileProvider == webHostFileProvider); 70var webHostEnvironment = Mock.Of<IWebHostEnvironment>(e => e.WebRootFileProvider == webHostFileProvider); 83var webHostEnvironment = httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
MvcDataAnnotationsMvcOptionsSetup.cs (2)
19services.AddSingleton<IWebHostEnvironment>(Mock.Of<IWebHostEnvironment>());
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.Localization.Test (10)
ViewLocalizerTest.cs (10)
30var hostingEnvironment = new Mock<IWebHostEnvironment>(); 54var hostingEnvironment = new Mock<IWebHostEnvironment>(); 86var hostingEnvironment = new Mock<IWebHostEnvironment>(); 120var hostingEnvironment = new Mock<IWebHostEnvironment>(); 145var hostingEnvironment = new Mock<IWebHostEnvironment>(); 171var hostingEnvironment = new Mock<IWebHostEnvironment>(); 195var hostingEnvironment = new Mock<IWebHostEnvironment>(); 219var hostingEnvironment = new Mock<IWebHostEnvironment>(); 243var hostingEnvironment = new Mock<IWebHostEnvironment>(); 267var hostingEnvironment = new Mock<IWebHostEnvironment>();
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)
11private readonly IWebHostEnvironment _hostingEnvironment; 13public MvcRazorRuntimeCompilationOptionsSetup(IWebHostEnvironment hostingEnvironment)
FileProviderRazorProjectFileSystem.cs (2)
14private readonly IWebHostEnvironment _hostingEnvironment; 16public FileProviderRazorProjectFileSystem(RuntimeCompilationFileProvider fileProvider, IWebHostEnvironment hostingEnvironment)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (37)
CSharpCompilerTest.cs (31)
24var hostingEnvironment = Mock.Of<IWebHostEnvironment>(e => e.ApplicationName == name); 38var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 58var hostingEnvironment = new Mock<IWebHostEnvironment>(); 76var hostingEnvironment = new Mock<IWebHostEnvironment>(); 90var hostingEnvironment = Mock.Of<IWebHostEnvironment>(h => h.EnvironmentName == "Development"); 120var hostingEnvironment = Mock.Of<IWebHostEnvironment>(h => h.EnvironmentName == "Development"); 133var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 148var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 162var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 177var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 192var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 205var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 219var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 233var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 247var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 262var hostingEnvironment = Mock.Of<IWebHostEnvironment>(); 305IWebHostEnvironment hostingEnvironment,
FileProviderRazorProjectFileSystemTest.cs (1)
253Mock.Of<IWebHostEnvironment>(e => e.ContentRootPath == contentRootPath));
RuntimeViewCompilerTest.cs (5)
785var csharpCompiler = new TestCSharpCompiler(referenceManager, Mock.Of<IWebHostEnvironment>()) 805var csharpCompiler = new TestCSharpCompiler(referenceManager, Mock.Of<IWebHostEnvironment>()) 836var hostingEnvironment = Mock.Of<IWebHostEnvironment>(e => e.ContentRootPath == "BasePath"); 892public TestCSharpCompiler(RazorReferenceManager manager, IWebHostEnvironment hostingEnvironment)
Microsoft.AspNetCore.Mvc.Razor.Test (1)
DependencyInjection\MvcRazorMvcCoreBuilderExtensionsTest.cs (1)
37var hostingEnvironment = new Mock<IWebHostEnvironment>();
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
217collection.AddSingleton<IWebHostEnvironment>(new TestWebHostEnvironment());
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.Mvc.TagHelpers.Test (21)
DefaultFileVersionProviderTest.cs (2)
290var hostingEnv = Mock.Of<IWebHostEnvironment>(e => e.WebRootFileProvider == fileProvider);
DefaultTagHelperActivatorTest.cs (2)
23private readonly IWebHostEnvironment HostingEnvironment = Mock.Of<IWebHostEnvironment>();
EnvironmentTagHelperTest.cs (4)
89var hostingEnvironment = new Mock<IWebHostEnvironment>(); 133var hostingEnvironment = new Mock<IWebHostEnvironment>(); 168var hostingEnvironment = new Mock<IWebHostEnvironment>(); 193var hostingEnvironment = new Mock<IWebHostEnvironment>();
ImageTagHelperTest.cs (7)
146var hostingEnvironment = MakeHostingEnvironment(); 182var hostingEnvironment = MakeHostingEnvironment(); 242var hostingEnvironment = MakeHostingEnvironment(); 274var hostingEnvironment = MakeHostingEnvironment(); 313IWebHostEnvironment hostingEnvironment = null, 358private static IWebHostEnvironment MakeHostingEnvironment() 375var hostingEnvironment = new Mock<IWebHostEnvironment>();
LinkTagHelperTest.cs (3)
1099IWebHostEnvironment hostingEnvironment = null, 1168private static IWebHostEnvironment MakeHostingEnvironment() 1185var hostingEnvironment = new Mock<IWebHostEnvironment>();
ScriptTagHelperTest.cs (3)
1067IWebHostEnvironment hostingEnvironment = null, 1135private static IWebHostEnvironment MakeHostingEnvironment() 1152var hostingEnvironment = new Mock<IWebHostEnvironment>();
Microsoft.AspNetCore.Mvc.Test (15)
MvcOptionsSetupTest.cs (1)
307var hostingEnvironment = new Mock<IWebHostEnvironment>();
MvcServiceCollectionExtensionsTest.cs (14)
49services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 87services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 102services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 118services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 133services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 168services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 185services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 204services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 221services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 398var hostEnvironment = GetHostingEnvironment(); 399services.AddSingleton<IWebHostEnvironment>(hostEnvironment); 460services.AddSingleton<IWebHostEnvironment>(GetHostingEnvironment()); 669private IWebHostEnvironment GetHostingEnvironment() 671var environment = new Mock<IWebHostEnvironment>();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
290collection.AddSingleton<IWebHostEnvironment>(new TestWebHostEnvironment());
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.SpaServices.Extensions.Tests (1)
SpaServicesExtensionsTests.cs (1)
63services.AddSingleton(typeof(IWebHostEnvironment), new TestWebHostEnvironment());
Microsoft.AspNetCore.StaticAssets (14)
Development\StaticAssetDevelopmentRuntimeHandler.cs (5)
44var fileInfo = context.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootFileProvider.GetFileInfo(asset.AssetPath); 95var fileInfo = _context.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootFileProvider.GetFileInfo(_asset.AssetPath); 168IWebHostEnvironment environment, 308private sealed class FileExistsConstraint(IWebHostEnvironment environment) : IRouteConstraint 310private readonly IWebHostEnvironment _environment = environment;
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (2)
59var environment = services.GetRequiredService<IWebHostEnvironment>();
StaticAssetEndpointFactory.cs (1)
42var 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)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (11)
FallbackStaticFileTest.cs (7)
37var environment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>(); 56var environment = host.Services.GetRequiredService<IWebHostEnvironment>(); 105var environment = host.Services.GetRequiredService<IWebHostEnvironment>(); 122private static void AssertFileEquals(IWebHostEnvironment environment, string filePath, byte[] responseContent)
StaticFileMiddlewareTests.cs (4)
154var hostingEnvironment = host.Services.GetService<IWebHostEnvironment>(); 196var hostingEnvironment = host.Services.GetService<IWebHostEnvironment>();
Microsoft.AspNetCore.Tests (15)
WebApplicationTests.cs (15)
951var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 993var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 1061var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 1755Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment))); 1763Assert.Single(app.Services.GetRequiredService<IEnumerable<IWebHostEnvironment>>()); 1779Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment))); 2229var hostEnv = app.Services.GetRequiredService<Hosting.IWebHostEnvironment>(); 2256var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>(); 2286var webHostEnv = app.Services.GetRequiredService<IWebHostEnvironment>();
Negotiate.Client (1)
Startup.cs (1)
27public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Negotiate.Server (1)
Startup.cs (1)
35public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
NegotiateAuthSample (1)
Startup.cs (1)
47public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
OpenIdConnectSample (2)
Startup.cs (2)
20public Startup(IConfiguration config, IWebHostEnvironment env) 28public IWebHostEnvironment Environment { get; }
PathSchemeSelection (1)
Startup.cs (1)
56public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
RazorPagesWebSite (2)
StartupWithBasePath.cs (2)
11private readonly IWebHostEnvironment _hostingEnvironment; 13public StartupWithBasePath(IWebHostEnvironment hostingEnvironment)
RewriteSample (2)
Startup.cs (2)
11public Startup(IWebHostEnvironment environment) 16public IWebHostEnvironment Environment { get; private set; }
Sandbox (1)
Startup.cs (1)
24public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
SignalR.Client.FunctionalTestApp (1)
Startup.cs (1)
109public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger<Startup> logger)
SignalRSamples (1)
Startup.cs (1)
27public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
SimpleWebSiteWithWebApplicationBuilder (1)
Program.cs (1)
43app.MapGet("/webroot", (IWebHostEnvironment environment) => environment.WebRootPath);
SocialWeather (1)
Startup.cs (1)
22public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
StaticFileSample (1)
Startup.cs (1)
14public void Configure(IApplicationBuilder app, IWebHostEnvironment host)
StaticFilesAuth (3)
Startup.cs (3)
12public Startup(IConfiguration configuration, IWebHostEnvironment hostingEnvironment) 20public IWebHostEnvironment HostingEnvironment { get; } 70public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAuthorizationService authorizationService)