In the past I've had luck with logging exceptions to a webservice (as long as the client are allowed to log out to the internet) with code like the one below. This is for logging anything you're not already catching. If you compile your application in release mode but also include the pdb files, you will get a stacktrace with line numbers.
You should also log the version of your assembly to know what version of the application is giving you errors.
public void RegisterHandlers()
{
Application.ThreadException += new ThreadExceptionEventHandler(ThreadExceptionFunction);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionFunction);
}
private void UnhandledExceptionFunction(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
ExceptionLogger(e.StackTrace);
}
private void ThreadExceptionFunction(object sender, ThreadExceptionEventArgs args)
{
ExceptionLogger(args.Exception.StackTrace);
}
private void ExceptionLogger(string trace)
{
// log the message to a webservice
}