17 implementations of ContentRootPath
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
92public string ContentRootPath { get; set; } = "ContentRootPath";
Aspire.Hosting.Tests (1)
Dashboard\DashboardServiceTests.cs (1)
152public string ContentRootPath { get; set; } = default!;
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
293public string ContentRootPath { get; set; } = Directory.GetCurrentDirectory();
HotReloadServiceTests.cs (1)
280public string ContentRootPath { get; set; } = Directory.GetCurrentDirectory();
RazorComponentEndpointDataSourceTest.cs (1)
296public string ContentRootPath { get; set; } = Directory.GetCurrentDirectory();
RazorComponentEndpointInvokerTest.cs (1)
60public string ContentRootPath { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
RazorComponentsServiceCollectionExtensionsTest.cs (1)
145public string ContentRootPath { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Infrastructure\TestWebHostEnvironment.cs (1)
15public string ContentRootPath { get; set; }
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
24public string ContentRootPath { get; set; } = default!;
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1611public string ContentRootPath { get; set; } = null!;
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
265public string ContentRootPath { get; set; } = Directory.GetCurrentDirectory();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
341public string ContentRootPath { get; set; } = Directory.GetCurrentDirectory();
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiGeneratorTests.cs (1)
1032public string ContentRootPath { get; set; }
Microsoft.AspNetCore.Routing.Tests (1)
RouteHandlerOptionsTests.cs (1)
73public string ContentRootPath { get; set; }
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1878public string ContentRootPath { get; set; }
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaServicesExtensionsTests.cs (1)
105public string ContentRootPath { get; set; } = Directory.GetCurrentDirectory();
Microsoft.Extensions.Hosting (1)
Internal\HostingEnvironment.cs (1)
31public string ContentRootPath { get; set; } = string.Empty;
1 write to ContentRootPath
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironmentExtensions.cs (1)
74hostingEnvironment.ContentRootPath = contentRootPath;
94 references to ContentRootPath
Aspire.Hosting (1)
DistributedApplicationBuilder.cs (1)
153AppHostDirectory = options.ProjectDirectory ?? _innerBuilder.Environment.ContentRootPath;
Aspire.Hosting.Testing.Tests (2)
TestingBuilderTests.cs (1)
191Assert.Contains("TestingAppHost1", hostEnvironment.ContentRootPath);
TestingFactoryTests.cs (1)
62Assert.Contains("TestingAppHost1", appModel.ContentRootPath);
CatalogService (1)
CatalogApi.cs (1)
40var path = Path.Combine(environment.ContentRootPath, "Images", item.PictureFileName);
CreateDefaultBuilderApp (2)
Program.cs (2)
43if (!string.Equals(contentRoot, context.HostingEnvironment.ContentRootPath, StringComparison.Ordinal)) 45return $"ContentRootPath incorrect. Expected: {contentRoot} Actual: {context.HostingEnvironment.ContentRootPath}";
CreateDefaultBuilderOfTApp (2)
Program.cs (2)
55if (!string.Equals(contentRoot, context.HostingEnvironment.ContentRootPath, StringComparison.Ordinal)) 57return $"ContentRootPath incorrect. Expected: {contentRoot} Actual: {context.HostingEnvironment.ContentRootPath}";
FilesWebSite (5)
Controllers\DownloadFilesController.cs (5)
23var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 29var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 37var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 43var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 51var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt");
IdentitySample.DefaultUI (1)
Startup.cs (1)
24.SetBasePath(env.ContentRootPath)
IdentitySample.Mvc (1)
Startup.cs (1)
17.SetBasePath(env.ContentRootPath)
InMemory.FunctionalTests (1)
HttpsConnectionMiddlewareTests.cs (1)
37env.SetupGet(e => e.ContentRootPath).Returns(Directory.GetCurrentDirectory());
Microsoft.AspNetCore (6)
ConfigureHostBuilder.cs (1)
66var previousContentRoot = HostingPathResolver.ResolvePath(_context.HostingEnvironment.ContentRootPath);
ConfigureWebHostBuilder.cs (2)
39var previousContentRoot = HostingPathResolver.ResolvePath(_context.HostingEnvironment.ContentRootPath); 116var previousContentRoot = HostingPathResolver.ResolvePath(_context.HostingEnvironment.ContentRootPath);
WebHost.cs (3)
123/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 142/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 292/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>,
Microsoft.AspNetCore.DataProtection (1)
Internal\HostingApplicationDiscriminator.cs (1)
34var contentRoot = _hosting?.ContentRootPath?.Trim();
Microsoft.AspNetCore.DataProtection.Tests (3)
DataProtectionUtilityExtensionsTests.cs (3)
31mockEnvironment.Setup(o => o.ContentRootPath).Returns(contentRootPath); 62mockEnvironment.Setup(o => o.ContentRootPath).Returns(contentRootPath); 89mockEnvironment.SetupGet(o => o.ContentRootPath).Throws(new InvalidOperationException("Hosting environment should not be checked"));
Microsoft.AspNetCore.Hosting (6)
GenericHost\WebHostBuilderBase.cs (1)
85webHostBuilderContext.HostingEnvironment.Initialize(context.HostingEnvironment.ContentRootPath, options, baseEnvironment: context.HostingEnvironment);
Internal\HostingEnvironmentExtensions.cs (3)
75hostingEnvironment.ContentRootFileProvider = baseEnvironment?.ContentRootFileProvider ?? new PhysicalFileProvider(hostingEnvironment.ContentRootPath); 81var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 89hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot);
Internal\WebHostOptions.cs (1)
26ContentRootPath = environment?.ContentRootPath ?? GetConfig(WebHostDefaults.ContentRootKey);
WebHostExtensions.cs (1)
120Console.WriteLine($"Content root path: {hostingEnvironment?.ContentRootPath}");
Microsoft.AspNetCore.Hosting.Tests (7)
HostingEnvironmentExtensionsTests.cs (3)
26Assert.Equal(Path.GetFullPath("."), env.ContentRootPath); 39Assert.Equal(Path.GetFullPath("testroot"), env.ContentRootPath); 52Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.ContentRootPath);
WebHostBuilderTests.cs (4)
659Assert.Equal("/", host.Services.GetService<IHostEnvironment>().ContentRootPath); 660Assert.Equal("/", host.Services.GetService<IWebHostEnvironment>().ContentRootPath); 678var basePath = host.Services.GetRequiredService<IHostEnvironment>().ContentRootPath; 701Assert.Equal(appBase, host.Services.GetService<IHostEnvironment>().ContentRootPath);
Microsoft.AspNetCore.HttpLogging (2)
FileLoggerProcessor.cs (2)
53_path = Path.Join(environment.ContentRootPath, "logs"); 57_path = Path.Join(environment.ContentRootPath, _path);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
FileProviderRazorProjectFileSystem.cs (2)
37return new FileProviderRazorProjectItem(fileInfo, basePath: string.Empty, filePath: path, root: _hostingEnvironment.ContentRootPath, fileKind); 66yield return new FileProviderRazorProjectItem(fileInfo, basePath, filePath: filePath, root: _hostingEnvironment.ContentRootPath);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
FileProviderRazorProjectFileSystemTest.cs (1)
253Mock.Of<IWebHostEnvironment>(e => e.ContentRootPath == contentRootPath));
RuntimeViewCompilerTest.cs (1)
836var hostingEnvironment = Mock.Of<IWebHostEnvironment>(e => e.ContentRootPath == "BasePath");
Microsoft.AspNetCore.Server.Kestrel.Core (7)
Internal\CertificatePathWatcher.cs (1)
32hostEnvironment.ContentRootPath,
Internal\Certificates\CertificateConfigLoader.cs (3)
39var certificatePath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!); 45var certificateKeyPath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.KeyPath); 74return (new X509Certificate2(Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!), certInfo.Password), fullChain);
ListenOptionsHttpsExtensions.cs (3)
39return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName))); 53return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password)); 68return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password), configureOptions);
Microsoft.AspNetCore.SpaServices.Extensions (1)
StaticFiles\DefaultSpaStaticFileProvider.cs (1)
32env.ContentRootPath,
Microsoft.AspNetCore.StaticFiles (1)
StaticFileMiddleware.cs (1)
49_logger.WebRootPathNotFound(Path.GetFullPath(Path.Combine(hostingEnv.ContentRootPath, hostingEnv.WebRootPath ?? "wwwroot")));
Microsoft.AspNetCore.Tests (24)
WebApplicationTests.cs (24)
514Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 543Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 585Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 627Assert.Equal(NormalizePath(AppContext.BaseDirectory), NormalizePath(builder.Environment.ContentRootPath)); 651Assert.Equal(NormalizePath(Environment.CurrentDirectory), NormalizePath(builder.Environment.ContentRootPath)); 676Assert.Equal(NormalizePath(AppContext.BaseDirectory), NormalizePath(builder.Environment.ContentRootPath)); 810Assert.Equal(contentRoot, context.HostingEnvironment.ContentRootPath); 816Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 859Assert.Equal(contentRoot, context.HostingEnvironment.ContentRootPath); 865Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 905Assert.Equal(contentRoot, context.HostingEnvironment.ContentRootPath); 911Assert.Equal(contentRoot, builder.Environment.ContentRootPath); 1484Assert.Equal(env0.ContentRootPath, env1.ContentRootPath); 2260Assert.Equal(builder.Environment.ContentRootPath, hostEnv.ContentRootPath); 2264Assert.Equal(webHostEnv.ContentRootPath, hostEnv.ContentRootPath); 2268Assert.NotEqual(contentRoot, hostEnv.ContentRootPath); 2290Assert.Equal(builder.Environment.ContentRootPath, hostEnv.ContentRootPath); 2294Assert.Equal(webHostEnv.ContentRootPath, hostEnv.ContentRootPath); 2298Assert.Equal(Path.GetTempPath(), hostEnv.ContentRootPath);
Microsoft.Extensions.Hosting (10)
Host.cs (4)
21/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 40/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 65/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 83/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item>
HostApplicationBuilder.cs (3)
41/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 63/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 279string previousContentRootPath = _hostApplicationBuilder._hostBuilderContext.HostingEnvironment.ContentRootPath;
HostApplicationBuilderSettings.cs (1)
31/// * set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>
HostingHostBuilderExtensions.cs (1)
181/// * set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>
Internal\ConsoleLifetime.cs (1)
104Logger.LogInformation("Content root path: {ContentRoot}", Environment.ContentRootPath);
Microsoft.Extensions.Hosting.Abstractions (2)
HostDefaults.cs (1)
22/// The configuration key used to set <see cref="IHostEnvironment.ContentRootPath"/>
IHostEnvironment.cs (1)
32/// Gets or sets an <see cref="IFileProvider"/> pointing at <see cref="ContentRootPath"/>.
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.cs (1)
96Environment.EnvironmentName, Environment.ContentRootPath);
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
81Environment.EnvironmentName, Environment.ContentRootPath);
StaticFilesAuth (2)
Startup.cs (2)
30var basePath = Path.Combine(HostingEnvironment.ContentRootPath, "PrivateFiles"); 86var files = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "PrivateFiles"));