dotnet / deployment-tools

This repo contains the code to build the .NET deployment tools and installers for all supported platforms, as well as the sources to .NET deployment tools.
MIT License
170 stars 51 forks source link

.Net8 ClickOnce app HARD crashes when launched with arguments. #338

Open MrFJ opened 7 months ago

MrFJ commented 7 months ago

Description

I’m trying to launch an offline WPF ClickOnce app from another app, with launch parameters. After trying many different solutions, I think I’ve found a solution, except I’ve run into an issue: The app crashes as soon as I launch it, just after checking for new version, before even getting into the code. No exceptions, no logs, no windows event log. As far as I can tell this way of launching the app would have worked at least in .Net Framework, but perhaps even in .Net 6 (Sources are unclear)

Configuration

.Net 8 Windows 10, Visual Studio 2022 Any architecture.

Regression?

Sources on the internet claim it worked in .Net framework. Whether it worked in .Net 5 or .Net 6 is unclear to me.

Other information

To replicate the issue, create a new WPF click once app in .Net 8 (Or .Net 7). Publish it to a network drive. Install it, then try to launch it from a command prompt using the following command: “%appdata%\Microsoft\Windows\Start Menu\Programs[PUBLISHERNAME][APPNAME].appref-ms” test

More info on journey with this issue: https://stackoverflow.com/questions/77859562/clickonce-net7-wpf-app-why-is-activationuri-null

NikolaMilosavljevic commented 4 months ago

[Triage] @NikolaMilosavljevic please investigate.

FFPJKamstrup commented 4 months ago

I found a "Fix": Deleting the hidden .vs folder fixed the issue. It returns once in a while and I have to delete the .vs folder again before publishing. It's weird, but it works. I wish I knew why...