Hi,
I have a GpAddin that is occasionally throwing an unhandled exception. Can anyone tell me how I go about capturing it, or the details of the exception?
If you wrap a function in a try...catch then any exceptions are caught by that function, however as soon as the exception leaves that function GP kicks in and closes down. I've tried AppDomain.CurrentDomain.UnhandledException and Application.ThreadException with no luck. As there are a lot of fucntions I dont want to have to wrap each one in a handler.
Thanks
Tim
*This post is locked for comments
Hi,
if you are creating a custom process in VS Tools, make sure that you must create a event log to trace the log details.
Hi Andrew,
That’s the conclusion I've come to as well. As soon as an exception leaves the function that it was raised in GP grabs it and shuts down. After much digging around it looks like GP has a global exception handler, which you can’t override from an AddIn It looks like I'll be spending some time putting exception handling into existing functions :(
Thanks
Tim
Hi Tim
From my experience of developing with VSTools, you will need {try..catch} code around every event handling entry point into your Addin logic
(i.e. void Login_CloseAfterOriginal(object sender, EventArgs e) {try ..catch } )
If you don't incorporate exception handling and an exception occurs, GP will crash and no record of the cause of the fault will be recorded in the event log.
Regards
Andrew Dean
Tim,
Please find link : blogs.msdn.com/.../debugging-visual-studio-tools-tips.aspx
You can debug your application I have used and work like champ.
Thanks
Sandip Jadhav
Hi,
there must be a log in Application,Dexterity. please recheck the error occurrence.
Hi Nataraj,
I've already tried looking at the event log, unfortunately no detailed information is put in there. All that’s there is related to Dynamics GP itself not the GpAddIn,
Thanks
Tim
Hi,
Please use Event viewer to trace the exceptional error.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156