views:

219

answers:

3

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.

A: 

You can use System.Diagnostics.EventLog

Ray
I don't think you can use System.Diagnostics.EventLog to initiate the sending of a WER error report from the client machine to Microsoft's server. If this is indeed what you meant, can you please elaborate on how exactly this can be done?
urig
Ah, I see - I thought you meant accessing the windows error log - soryy for the error
Ray
A: 

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

Coder 42
Thanks for the link to the WER Services project. But it looks like that project is all about getting the data from MS and configuring cabs and buckets. Whereas what I need is the ability to initiate error reports from my client software. Basically the .net equivalent of this: http://msdn.microsoft.com/en-us/library/bb513625%28VS.85%29.aspx Do you know if WER Services can do that?
urig
+1  A: 

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.

John Knoeller