I have a C# program (target framework .NET 4.0) which makes calls to COM objects (unmanaged code), all objects managed properly, destroyed when no longer required, etc.
One of your COM coomponents is causing the exception as indicated by:
Message=External component has thrown an exception
These two lines should help you locate which COM component and the called method that is causing the problem:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
I take it that you've written a wrapper in order to interface to these COM components? Or are you using direct Invoke calls?
Perhaps the InnerException information would give you more details.
Basically look for anything that you may recognise as being related to these COM components.