-
Notifications
You must be signed in to change notification settings - Fork 329
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
App on Microsoft Store runs fine on most user systems but fails to run on others with a stowed exception being reported in MS Partner Center #4861
Comments
This was created from Discussion #4853. |
Hi @JosHuybrighs, |
I reported the exception in Feedback Hub 5 minutes ago. A minidump file is attached. |
@JosHuybrighs Please include a link to the feedback hub issue you created. |
Michael will take a looksee |
Thanks for sharing a dump, @JosHuybrighs! I stored some additional notes about it in this (internal tracking issue). The minidump doesn't contain many clues. It shows a C# exception was thrown during initialization and XAML's DirectUI::FrameworkApplication::StartDesktop() recorded that as a fatal error. The exception is thrown in the Start initialization function, which by default looks like this: global::Microsoft.UI.Xaml.Application.Start((p) => {
var context = new global::Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext(global::Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread());
global::System.Threading.SynchronizationContext.SetSynchronizationContext(context);
new App();
}); The only possibilities are that the exception happened during those lines before the App construction or that it happened somewhere during the App construction. In analyzing the code, I don't see any possibility for this specific exception to be thrown by DispatcherQueue.GetForCurrentThread, or DispatcherQueueSynchronizationContext, or SetSynchronizationContext. Unless I missed something, that means this most likely happened in the App constructor. It might be helpful to add a try/catch in the constructor, though I'd expect your UnhandledException handler to still see something if you successfully registered that. Any member variables on the App which are initialized by default may also be opportunities for a failure, though. It might be worth reviewing those, and moving initialization into the constructor for any which have a higher risk of failure. If you're using custom initialization instead of XAML's generated Main function, then you should also look at anything custom done there. |
@JosHuybrighs were the comments from codendone helpful? If not, can you provide a repro. |
The comments definitely clarified certain things. In the mean time I have reworked the App's constructor to delay some of the more complicated initialization stuff to the For your information, the App's constructor looks as follows:
As I mentioned earlier, MS App Center doesn't show any exception that occured while still being in the App's constructor. It does show a couple of exceptions that occur in the
Reporting of exception in |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
Discussed in:
Originally posted by JosHuybrighs November 6, 2024
This is probably not the right place to have this discussion but I don't know where else I can bring this up.
I have a desktop app on the Microsoft Store that uses the WinAppSDK and runs successfully on most of the user's computers.
For some systems however the Microsoft Partner Center's health section for the app shows a lot of 'stowed exceptions' occurring when the application is being started.
The stack trace is only:
Some have a minidump file attached which when analyzing with WinDbg shows:
I understand that the error is most likely due to an unhandled exception within a WinRT or COM API which my application is calling.
To trap those exceptions the app constructor takes care of this like so (I am using MS AppCenter to track faults):
AppUnhandledException(e.Exception) makes a large string of the stack and sends it in chunks to MS AppCenter.
I don't get anything however in MS AppCenter that relates to
DirectUI::FrameworkApplication::StartDesktop
.So, are there any suggestions how to deal with this?
I just saw myself that it is probably better to do
EnableLogging()
(it accessesApplicationDataContainer
in local settings to see if logging is enabled) after the registration for unhandled events and so I will do that in the next update of the app and see what it gives.In the mean time however what remains important: on most user's system this error doesn't come up. Why on others? The app is deployed selfcontained and so I have to expect that there shouldn't be any wrong or missing DLLs in the package.
Or is it not that simple?
I keep thinking that a WinAppSDK/WinUI desktop app needs certain dlls in Windows that are not part of the package but aren't necessarily available on a user's system. If so, shouldnt there be an error when the app is being installed?
The text was updated successfully, but these errors were encountered: