For a quick solution to your problem (if you donβt have time to rewrite the code), see the event log on the computer on which you launched the application. There is a great chance that you just skip some DLLs.
As a long-term solution, I think you can start by adding some logging functions to your application (corporate library, log4net, etc. or even your own registrar). Printing a full stack trace is an invaluable source of help, especially when you include .pdb files in your version. This will allow your executed code to indicate exactly which line threw the exception.
Hope this helps, Peter
source share