✅ WPF app keeps launching Console Window
Hey all, new here, I believe this is the correct forum to ask this. Anyways, I am building a wpf app as an output of "wpf app", yet whenever I launch the self contained exe after publishing it through vs 22 (to local, you can see the attached screenshots), the app keeps launching the console window on startup (and if I close the console window manually, the app closes with it). I'm having troubles finding an answer to this on the ol' google.
An even weirder confusing piece to me is while I normally work from my desktop/the screenshots are from my desktop, if I publish from my work laptop, the app doesn't launch a console window at all, just launches normally (and as far as I can tell, all of those settings are the same on the laptop as my desktop/screenshots).
Thanks for any advice or help.
8 Replies
Is it the exact same code on both laptop and desktop? Have you tried publishing via
dotnet publish
instead of the VS wizard?yes, it's the same. Using dotnet publish instead of vs wizard fixes it, which is odd. I'll have to try setting up a new but identical publish profile to see if the wizard is just bugged out
Thanks!
Check in here.
Found the problem with the wizard: including <OutputType>Exe</OutputType> in the publish profile xml caused the publish to launch the console with the exe for some reason
removing that removes the console host launch
👍
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.