web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

GpAddIn - Catching an unhandled exception

(0) ShareShare
ReportReport
Posted on by 150

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

  • Community Member Profile Picture
    on at

    Hi,

    Please use Event viewer to trace the exceptional error.

  • tag1971 Profile Picture
    150 on at

    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

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    there must be a log in Application,Dexterity. please recheck the error occurrence.

  • Suggested answer
    sandipdjadhav Profile Picture
    18,361 on at

    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

  • Suggested answer
    Andrew John Dean Profile Picture
    1,337 on at

    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

  • Verified answer
    tag1971 Profile Picture
    150 on at

    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

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans