Еmbed the wwwroot directory and it's contents in order to create a single file executable when using Blazor in WPF
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Generating single-file executable not working in _WPF Blazor_ application, which is an installation inconvenience. Also, this may be considered as a **security vulnerability** if someone changes the JS files inside the _wwwroot_ folder?
In the publish directory, there's a _wwwroot_ folder next to the executable containing static assets:

Not working even if you try to embed everything in _wwwroot_ folder with the following addition to the `.csproj` file, because there are some files generated on build/publish (like the CSS isolation bundling file `{ASSEMBLY NAME}.styles.css`):
```
```
### Expected Behavior
Possibility to publish a WPF Blazor application (or any other BlazorWebView based application) as a single-file.
### Steps To Reproduce
1. [Create WPF Blazor application](https://learn.microsoft.com/en-us/aspnet/core/blazor/hybrid/tutorials/wpf?view=aspnetcore-7.0)
2. Publish the project as single-file using the following command: `dotnet publish -r win-x64 --self-contained true -p:PublishSingleFile=true`
### Exceptions (if any)
_No response_
### .NET Version
7.0.401
### Anything else?
BlazorWebView itself has the ability to load and operate with embedded static files. However, in order for this to work, the wwwroot files should be present before publishing/embedding them. The publishing step would first have to generate the _wwwroot_ files before they could be embedded.
Contributor guide
Assessment
This issue has not been assessed yet.