Surface project item to control static asset publishing (#15584)

pull/15587/head
Luke Latham 2019-11-07 13:42:18 -06:00 committed by GitHub
parent 65206da83d
commit cacb1b8ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -5,7 +5,7 @@ description: Learn the foundational concepts for building ASP.NET Core apps.
monikerRange: '>= aspnetcore-2.1'
ms.author: riande
ms.custom: mvc
ms.date: 10/07/2019
ms.date: 11/07/2019
uid: fundamentals/index
---
# ASP.NET Core fundamentals
@ -297,6 +297,14 @@ The web root path defaults to *{content root}/wwwroot*, but a different web root
::: moniker-end
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 the *wwwroot/local* directory and sub-directories:
```xml
<ItemGroup>
<Content Update="wwwroot\local\**\*.*" CopyToPublishDirectory="Never" />
</ItemGroup>
```
In Razor (*.cshtml*) files, the tilde-slash (`~/`) points to the web root. A path beginning with `~/` is referred to as a *virtual path*.
For more information, see <xref:fundamentals/static-files>.