Skip to content

Commit 317f8d5

Browse files
authored
Make ContentRoot and WebRoot coverage consistent (#17801)
1 parent e89d2de commit 317f8d5

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

aspnetcore/fundamentals/host/generic-host.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Inject the <xref:Microsoft.Extensions.Hosting.IHostEnvironment> service into a c
149149

150150
* [ApplicationName](#applicationname)
151151
* [EnvironmentName](#environmentname)
152-
* [ContentRootPath](#contentrootpath)
152+
* [ContentRootPath](#contentroot)
153153

154154
Web apps implement the `IWebHostEnvironment` interface, which inherits `IHostEnvironment` and adds the [WebRootPath](#webroot).
155155

@@ -192,7 +192,7 @@ The [IHostEnvironment.ApplicationName](xref:Microsoft.Extensions.Hosting.IHostEn
192192

193193
To set this value, use the environment variable.
194194

195-
### ContentRootPath
195+
### ContentRoot
196196

197197
The [IHostEnvironment.ContentRootPath](xref:Microsoft.Extensions.Hosting.IHostEnvironment.ContentRootPath*) property determines where the host begins searching for content files. If the path doesn't exist, the host fails to start.
198198

@@ -408,14 +408,14 @@ Kestrel has its own endpoint configuration API. For more information, see <xref:
408408

409409
### WebRoot
410410

411-
The relative path to the app's static assets.
411+
The [IWebHostEnvironment.WebRootPath](xref:Microsoft.AspNetCore.Hosting.IWebHostEnvironment.WebRootPath) property determines the relative path to the app's static assets. If the path doesn't exist, a no-op file provider is used.
412412

413413
**Key**: `webroot`
414414
**Type**: `string`
415-
**Default**: The default is `wwwroot`. The path to *{content root}/wwwroot* must exist. If the path doesn't exist, a no-op file provider is used.
415+
**Default**: The default is `wwwroot`. The path to *{content root}/wwwroot* must exist.
416416
**Environment variable**: `<PREFIX_>WEBROOT`
417417

418-
To set this value, use the environment variable or call `UseWebRoot`:
418+
To set this value, use the environment variable or call `UseWebRoot` on `IWebHostBuilder`:
419419

420420
```csharp
421421
webBuilder.UseWebRoot("public");
@@ -424,7 +424,7 @@ webBuilder.UseWebRoot("public");
424424
For more information, see:
425425

426426
* [Fundamentals: Web root](xref:fundamentals/index#web-root)
427-
* [ContentRootPath](#contentrootpath)
427+
* [ContentRoot](#contentroot)
428428

429429
## Manage the host lifetime
430430

@@ -1124,7 +1124,7 @@ Inject the <xref:Microsoft.Extensions.Hosting.IHostEnvironment> service into a c
11241124

11251125
* [ApplicationName](#applicationname)
11261126
* [EnvironmentName](#environmentname)
1127-
* [ContentRootPath](#contentrootpath)
1127+
* [ContentRootPath](#contentroot)
11281128

11291129
Web apps implement the `IWebHostEnvironment` interface, which inherits `IHostEnvironment` and adds the [WebRootPath](#webroot).
11301130

@@ -1167,7 +1167,7 @@ The [IHostEnvironment.ApplicationName](xref:Microsoft.Extensions.Hosting.IHostEn
11671167

11681168
To set this value, use the environment variable.
11691169

1170-
### ContentRootPath
1170+
### ContentRoot
11711171

11721172
The [IHostEnvironment.ContentRootPath](xref:Microsoft.Extensions.Hosting.IHostEnvironment.ContentRootPath*) property determines where the host begins searching for content files. If the path doesn't exist, the host fails to start.
11731173

@@ -1396,14 +1396,14 @@ Kestrel has its own endpoint configuration API. For more information, see <xref:
13961396

13971397
### WebRoot
13981398

1399-
The relative path to the app's static assets.
1399+
The [IWebHostEnvironment.WebRootPath](xref:Microsoft.AspNetCore.Hosting.IWebHostEnvironment.WebRootPath) property determines the relative path to the app's static assets. If the path doesn't exist, a no-op file provider is used.
14001400

14011401
**Key**: `webroot`
14021402
**Type**: `string`
1403-
**Default**: The default is `wwwroot`. The path to *{content root}/wwwroot* must exist. If the path doesn't exist, a no-op file provider is used.
1403+
**Default**: The default is `wwwroot`. The path to *{content root}/wwwroot* must exist.
14041404
**Environment variable**: `<PREFIX_>WEBROOT`
14051405

1406-
To set this value, use the environment variable or call `UseWebRoot`:
1406+
To set this value, use the environment variable or call `UseWebRoot` on `IWebHostBuilder`:
14071407

14081408
```csharp
14091409
webBuilder.UseWebRoot("public");
@@ -1412,7 +1412,7 @@ webBuilder.UseWebRoot("public");
14121412
For more information, see:
14131413

14141414
* [Fundamentals: Web root](xref:fundamentals/index#web-root)
1415-
* [ContentRootPath](#contentrootpath)
1415+
* [ContentRoot](#contentroot)
14161416

14171417
## Manage the host lifetime
14181418

aspnetcore/fundamentals/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ The content root is the base path for:
199199
* Data files (*.db*)
200200
* The [Web root](#web-root), typically the *wwwroot* folder.
201201

202-
During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [Web root](#web-root). Specify a different content root by setting its path when [building the host](#host). For more information, see [Content root](xref:fundamentals/host/generic-host#contentrootpath-1).
202+
During development, the content root defaults to the project's root directory. This directory is also the base path for both the app's content files and the [Web root](#web-root). Specify a different content root by setting its path when [building the host](#host). For more information, see [Content root](xref:fundamentals/host/generic-host#contentroot).
203203

204204
## Web root
205205

@@ -209,7 +209,7 @@ The web root is the base path for public, static resource files, such as:
209209
* JavaScript (*.js*)
210210
* Images (*.png*, *.jpg*)
211211

212-
By default, static files are served only from the web root directory and its sub-directories. The web root path defaults to *{content root}/wwwroot*. Specify a different web root by setting its path when [building the host](#host). For more information, see [Web root](xref:fundamentals/host/generic-host#webroot-1).
212+
By default, static files are served only from the web root directory and its sub-directories. The web root path defaults to *{content root}/wwwroot*. Specify a different web root by setting its path when [building the host](#host). For more information, see [Web root](xref:fundamentals/host/generic-host#webroot).
213213

214214
Prevent publishing files in *wwwroot* with the [\<Content> project item](/visualstudio/msbuild/common-msbuild-project-items#content) in the project file. The following example prevents publishing content in *wwwroot/local* and its sub-directories:
215215

0 commit comments

Comments
 (0)