dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.57k stars 10.05k forks source link

Еmbed the wwwroot directory and it's contents in order to create a single file executable when using Blazor in WPF #50894

Open vncpetrov opened 1 year ago

vncpetrov commented 1 year ago

Is there an existing issue for this?

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: image

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):

<ItemGroup>
    <EmbeddedResource Include="wwwroot\**\*" />
</ItemGroup>

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
  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.

ghost commented 1 year ago

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

kmanev073 commented 1 year ago

I have the same issue, is there any way to fix this in .NET 7?

ghost commented 12 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

stealthin commented 7 months ago

Hey there. I encounter the exact same issue and it prevents me from distributing my application. Can we have a status on this?