dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.05k stars 1.17k forks source link

WPF ClickOnce Deployment missing refs folder #8455

Open jwwise-best opened 10 months ago

jwwise-best commented 10 months ago

Description

I have a WPF application based on the SDK project type Microsoft.NET.Sdk. A feature of this application is to start a local MVC site as part of the application using the WebApplication builder. This has been an issue with .NET 6/7/8. When publishing a ClickOnce deployment it does not include the "refs" subfolder which is created when building the application. Because of this running the ClickOnce deployed application fails to be able to render hosted web pages exhibited out of the WPF application. Only by copying the refs folder manually to the target system am I able to render the local hosted MVC razor pages. I need a way to either make the refs folder not required, or a way of adding them into the ClickOnce deployment process.

Reproduction Steps

Create a wpf application. Add a web application listener within the startup. Publish a ClickOnce package. Install the ClickOnce package. Try to navigate to a page within the web application.

Expected behavior

To be able to render pages from a local web application listener within a WPF application and deploy using ClickOnce package without need of intervention.

Actual behavior

Fail to render page from local web application listener within a WPF application that was deployed using a ClickOnce package.

Regression?

No response

Known Workarounds

Copying the refs folder down from a published location upon application startup, and require restart.

Impact

No response

Configuration

Windows only due to WPF installation .NET 6/7/8 x64

Not specific to any configuration other than hosting a web application listener inside a WPF application.

Other information

No response

singhashish-wpf commented 10 months ago

@jwwise-best could you please share a minimal repro?

jwwise-best commented 10 months ago

Here is a new repository with the minimal example.

https://github.com/BEST-Robotics/dotnet-wpf-mvc-sample

I believe this may be because of the RuntimeCompilation option, however, the pages do not resolve without it.