UWP: Unspecified Error - Exception from HRESULT: 0x80004005

8

I am developing a UWP app in C# and I have attached a handler for Unhandled exceptions that sends us the unhandled exceptions so that we can diagnose them).

I am receiving a large amount of

System.Exception - Unspecified error (Exception from HRESULT: 0x80004005)

without any stacktrace nor other additional information.

This has never happened locally in debug, but only in production for real users, that never complained about this problem, so I guess this seems to be a silent error that may not affect the users.

Anyway, I am a little bit uneasy about leaving this issue unsolved.

How can I find the culprit of this issue?

Has anyone ever bumped into this issue before?

Thanks!

c#
exception
uwp
unhandled-exception

2 Answers

0

Checking it on the Microsoft Support, i found 2 references that are very distinct about the 0x80004005.

The first was about Windows XP Ativation, that would indicate that the Windows was not activated properly - that message could still be the same on Windows 10, but the microsoft page was not enought to accert that.

Another reference though was about a security release from Windows Update (on Windows 10) that had the same error code (for PC's without the update KB3087040); seems to be more likely.

answered on Stack Overflow Mar 16, 2021 by SammuelMiranda
0

Without a proper error or exception it will be close to impossible to resolve or attempt to answer.

In the past when faced with a similar issue (local ok, dev ok but production fails) my solution and that of many other developers is to narrow it down and assert where is the exception being thrown in the app.

hypothesis: If the exception wasn't handle we should have seen the app failing - potentially it is encapsulated in a catch statement.

To begin we need to add some logging you could use log4net

If the hypothesis is correct - add a logging in each and every catch statement in your app. Depends on the scale of your app - this will take some time to debug.

Hopefully the catching and logging will give you an insight and resolve your issue.

Also could add logging where a resource its been accessed.

answered on Stack Overflow Mar 18, 2021 by Alex Leo

User contributions licensed under CC BY-SA 3.0