dotnet / dotnet/wpf

.net6+ WPF application: MsBuild publish task does not generate web page

Open
#8,876 3 comments 0 reactions 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

MSBuild publish task does not use all of the pubxml configuration while Visual Studio publish does.

### Reproduction Steps

- In Visual Studio create new project by using the Create "WPF Application" wizard. Select for instance Framework .net8.
- In Visual Studio right click on the project and select "Publish"
- In the publish dialog configure
- Publish location: bin\publish\
- Install location: http://localhost/clickonce/
- ...
- Select Finish
- Notice the output
- In the "Developer Powershell for VS 2022" run the following command : `msbuild WpfApplication.csproj /t:publish /p:PublishProfile=ClickOnceProfile /p:PublishDir=bin/publish`

### Expected behavior

The expected behavior is that the publish output would be the same as seen through the Visual Studio Publish dialog.

### Actual behavior

The output looks like it picks up only some of the pubxml configuration. This means that the output from the publish task looks like a install from Disk application instead of install from Web application.

### Regression?

This works in .net framework 4.8

### Known Workarounds

Generate html page and remove the launcher.exe

### Impact

Click once deployments done for migrated applications do not work without applying workaround. This makes it harder to automate WPF application builds.

### Configuration

- .net 6, 8
- Windows WPF application
- x86, x64

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.