Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message boxes used to report issues often don't stay open #904

Closed
corbob opened this issue Jan 15, 2022 · 1 comment · Fixed by #905
Closed

Message boxes used to report issues often don't stay open #904

corbob opened this issue Jan 15, 2022 · 1 comment · Fixed by #905
Assignees
Labels
5 - Released The issue has been resolved, and released to the public for consumption Bug Issues where something has happened which was not expected or intended
Milestone

Comments

@corbob
Copy link
Member

corbob commented Jan 15, 2022

What You Are Seeing?

In issues #864 and #897 both should display a message box, but even when debugging that message box almost immediately disappears.

What is Expected?

The message boxes stay open allowing the user to see them and acknowledge them.

How Did You Get This To Happen? (Steps to Reproduce)

See issues #864 and #897 for reproduction steps of those and see the messagebox staying open.

A potential workaround is documented in this forum post from 2009: https://social.msdn.microsoft.com/Forums/vstudio/en-US/116bcd83-93bf-42f3-9bfe-da9e7de37546/messagebox-closes-immediately-in-dispatcherunhandledexception-handler?forum=wpf

System Details

  • OS Build (In PowerShell run [System.Environment]::OSVersion.version.tostring()): Windows 10 and 11
  • Windows PowerShell version (Run: $PSVersionTable): 5.1
  • Chocolatey version (Run choco --version): 0.11.3

Output Log

I don't have a log as this is a GUI issue, and in at least the two mentioned there's not actually anything logged to any Chocolatey log, you might see exceptions logged to Event Viewer after the fact though.

@corbob corbob added the Bug Issues where something has happened which was not expected or intended label Jan 15, 2022
@corbob corbob self-assigned this Jan 15, 2022
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 16, 2022
There appears to be a "feature" in WPF that prevents MessageBoxes from
displaying when there are no active windows. Many of our MessageBoxes
are to report errors, and many of them occur during startup. This
results in them not displaying as we haven't created any windows. This
works around that by creating a hidden window and closing it after the
MessageBox has been displayed.
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 16, 2022
There are 12 show methods in the MessageBox class, instead of just
wrapping the few we currently use, this adds wrappers for the rest.
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 16, 2022
There appears to be a "feature" in WPF that prevents MessageBoxes from
displaying when there are no active windows. Many of our MessageBoxes
are to report errors, and many of them occur during startup. This
results in them not displaying as we haven't created any windows. This
works around that by creating a hidden window and closing it after the
MessageBox has been displayed.
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 16, 2022
There are 12 show methods in the MessageBox class, instead of just
wrapping the few we currently use, this adds wrappers for the rest.
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 16, 2022
There appears to be a "feature" in WPF that prevents MessageBoxes from
displaying when there are no active windows. Many of our MessageBoxes
are to report errors, and many of them occur during startup. This
results in them not displaying as we haven't created any windows. This
works around that by creating a hidden window and closing it after the
MessageBox has been displayed.
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 16, 2022
There are 12 show methods in the MessageBox class, instead of just
wrapping the few we currently use, this adds wrappers for the rest.
@gep13 gep13 added this to the 0.20.0 milestone Jan 17, 2022
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 20, 2022
There appears to be a "feature" in WPF that prevents MessageBoxes from
displaying when there are no active windows. Many of our MessageBoxes
are to report errors, and many of them occur during startup. This
results in them not displaying as we haven't created any windows. This
works around that by creating a hidden window and closing it after the
MessageBox has been displayed.
corbob added a commit to corbob/ChocolateyGUI that referenced this issue Jan 20, 2022
There are 12 show methods in the MessageBox class, instead of just
wrapping the few we currently use, this adds wrappers for the rest.
gep13 pushed a commit to corbob/ChocolateyGUI that referenced this issue Jan 21, 2022
There appears to be a "feature" in WPF that prevents MessageBoxes from
displaying when there are no active windows. Many of our MessageBoxes
are to report errors, and many of them occur during startup. This
results in them not displaying as we haven't created any windows. This
works around that by creating a hidden window and closing it after the
MessageBox has been displayed.
gep13 pushed a commit to corbob/ChocolateyGUI that referenced this issue Jan 21, 2022
There appears to be a "feature" in WPF that prevents MessageBoxes from
displaying when there are no active windows. Many of our MessageBoxes
are to report errors, and many of them occur during startup. This
results in them not displaying as we haven't created any windows. This
works around that by creating a hidden window and closing it after the
MessageBox has been displayed.
gep13 added a commit that referenced this issue Jan 21, 2022
(#904) Wrap MessageBoxes with a hidden window
@AdmiringWorm AdmiringWorm added the 4 - Done Code has been added to the repository, and has been reviewed by a team member label Jan 21, 2022
@gep13
Copy link
Member

gep13 commented Feb 10, 2022

🎉 This issue has been resolved in version 0.20.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

@corbob corbob added 5 - Released The issue has been resolved, and released to the public for consumption and removed 4 - Done Code has been added to the repository, and has been reviewed by a team member labels Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released The issue has been resolved, and released to the public for consumption Bug Issues where something has happened which was not expected or intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants