Surface project item to control static asset publishing (#15584)
parent
65206da83d
commit
cacb1b8ed0
|
@ -5,7 +5,7 @@ description: Learn the foundational concepts for building ASP.NET Core apps.
|
||||||
monikerRange: '>= aspnetcore-2.1'
|
monikerRange: '>= aspnetcore-2.1'
|
||||||
ms.author: riande
|
ms.author: riande
|
||||||
ms.custom: mvc
|
ms.custom: mvc
|
||||||
ms.date: 10/07/2019
|
ms.date: 11/07/2019
|
||||||
uid: fundamentals/index
|
uid: fundamentals/index
|
||||||
---
|
---
|
||||||
# ASP.NET Core fundamentals
|
# ASP.NET Core fundamentals
|
||||||
|
@ -297,6 +297,14 @@ The web root path defaults to *{content root}/wwwroot*, but a different web root
|
||||||
|
|
||||||
::: moniker-end
|
::: 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*.
|
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>.
|
For more information, see <xref:fundamentals/static-files>.
|
||||||
|
|
Loading…
Reference in New Issue