Skip to content

Commit d1ed37c

Browse files
authored
Clarify Razor component requirement (#35987)
1 parent 55d77da commit d1ed37c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

aspnetcore/blazor/project-structure.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ In a Blazor WebAssembly app, the Blazor script content is located in the `wwwroo
600600
<script src="_framework/blazor.webassembly.js"></script>
601601
```
602602

603+
For a Blazor Web App or a Blazor Server app, the project must contain at least one Razor component file (`.razor`) in order to automatically include the Blazor script when the app is published. If the project doesn't contain at least one Razor component, set the `RequiresAspNetWebAssets` MSBuild property `true` in the app's project file to include the Blazor script:
604+
605+
```xml
606+
<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
607+
```
608+
603609
## Location of `<head>` and `<body>` content
604610

605611
:::moniker range=">= aspnetcore-8.0"

0 commit comments

Comments
 (0)