Is there a .Net API for Windows Error Reporting

穿精又带淫゛_ 提交于 2019-12-03 13:26:55

问题


Is there a .Net API for me to integrate Windows Error Reporting into my application?

I'm mostly interested in initiating error reports even for non-catastrophic errors occurring in my application and all I could find is the WIN32 API.


回答1:


It's not likely. WER isn't meant to be used by applications, its something that a user can choose to enable, and when (s)he does, all application crashes are turned into Windows Error Reports and sent to a central server. It's not something you turn on and off for individual applications. You generate an error report by crashing on a machine where the user has enabled WER.

Developers just have to register so that they can get the crash information on their products.

from http://msdn.microsoft.com/en-us/library/bb513641(VS.85).aspx

Developers can register with Windows Quality Online Services to get information about the problems customers are experiencing with their applications and help customers fix these problems. Developers can also use Application Recovery and Restart to ensure that customers do not lose data when their application crashes and allow users to quickly return to their tasks.

I'm sure you could use interop to call the WER api's, if you want to generate a report without crashing.




回答2:


The WER team have a project on Codeplex; there's a managed Services DLL downloadable from http://www.codeplex.com/wer/Release/ProjectReleases.aspx?ReleaseId=12825




回答3:


You can use System.Diagnostics.EventLog




回答4:


On my question to Microsoft I got the following answer:

Please look into the following url’ s for more information on the process of collecting crash dumps.

msdn.microsoft.com/en-us/windows/hardware/gg487440.aspx blogs.msdn.com/b/wer/archive/2012/03/28/windows-hardware-dashboard-reports-faq.aspx http://blogs.msdn.com/b/wer/archive/2009/03/16/faq.aspx

There I found this sample: http://www.microsoft.com/en-us/download/confirmation.aspx?id=29229 But it doesn't work. At now I'm trying to fix problem. Perhaps it is useful to someone.

UPDATE: I resolved this problem. I had an authorization problem for NTLM:-).

Before this code:

string challenge = LiveIdAuthentication.GetChallengeFromServiceRequest(request.RequestUri.AbsoluteUri);

I had added this:

IWebProxy webProxy = WebRequest.DefaultWebProxy;
webProxy.Credentials = CredentialCache.DefaultCredentials;
request.Proxy = webProxy;


来源:https://stackoverflow.com/questions/2082659/is-there-a-net-api-for-windows-error-reporting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!