Skip to content

Commit 263fdd2

Browse files
authored
Use a copy target for Blazor WASM custom web.config (#17619)
1 parent 8483cf7 commit 263fdd2

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

aspnetcore/host-and-deploy/blazor/webassembly.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to host and deploy a Blazor app using ASP.NET Core, Conte
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 03/16/2020
8+
ms.date: 04/06/2020
99
no-loc: [Blazor, SignalR]
1010
uid: host-and-deploy/blazor/webassembly
1111
---
@@ -85,6 +85,22 @@ When a Blazor project is published, a *web.config* file is created with the foll
8585
* URL Rewrite Module rules are established:
8686
* Serve the sub-directory where the app's static assets reside (*wwwroot/{PATH REQUESTED}*).
8787
* Create SPA fallback routing so that requests for non-file assets are redirected to the app's default document in its static assets folder (*wwwroot/index.html*).
88+
89+
#### Use a custom web.config
90+
91+
To use a custom *web.config* file:
92+
93+
1. Place the custom *web.config* file at the root of the project folder.
94+
1. Add the following target to the project file (*.csproj*):
95+
96+
```xml
97+
<Target Name="CopyWebConfigOnPublish" AfterTargets="Publish">
98+
<Copy SourceFiles="web.config" DestinationFolder="$(PublishDir)" />
99+
</Target>
100+
```
101+
102+
> [!NOTE]
103+
> Use of the MSBuild property `<IsWebConfigTransformDisabled>` set to `true` isn't supported in Blazor WebAssembly apps [as it is for ASP.NET Core apps deployed to IIS](xref:host-and-deploy/iis/index#webconfig-file). For more information, see [Copy target required to provide custom Blazor WASM web.config (dotnet/aspnetcore #20569)](https://github.com/dotnet/aspnetcore/issues/20569).
88104
89105
#### Install the URL Rewrite Module
90106

0 commit comments

Comments
 (0)