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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Exception has been thrown by the target of an invocation In NAV2015

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I have created a New DLL PDF Viewer and I was able to register that DLL and generate Public Token for the same . But when defined the Dll in Control Add-ins and trying to access the Control in a field in NAV2015 . Iam getting the following error:

"An error occurred while creating the control add-in for "NAVPDFViewer;PublicKeyToken=89634b7499535274". Error message: Exception has been thrown by the target of an invocation."

Iam not getting this error. Could any one help me out , how to resolve this.

Please help me!!!!!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at

    You didn't mention whether you pasted the assembly file in the Add-ins folder. By default, this is C:\Program Files\Microsoft Dynamics NAV\80\Service\Add-Ins?

  • Community Member Profile Picture
    on at

    Thank you very much for your reply sir!

    I was able to find this Path "C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Add-ins\NAVPDFViewer" and pasted the DLL file. But still it is throwing the error.

  • Community Member Profile Picture
    on at

    One thing I forgot to mention. I have Multiple version installed in my system. Starting from 4.-,5.0,6.0,7.0,7.1 and 8.0 with different build inside each version. Should I have add the DLL in these existing Versions also. So that this error gets resolved?

  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at

    In that case you can definitely try by adding in all Add-In folders

  • Community Member Profile Picture
    on at

    I have tried that option too.. but Still the same exists. Sir!

  • Community Member Profile Picture
    on at

    Still Same Error exists

  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at

    Then check whether you registered in Control Add-ins with proper name and Token.

  • Community Member Profile Picture
    on at

    I had added that Proper Name and Token  in Control Add-ins Properly sir! But still it is Throwing error!. Some thing I surprised!

  • Community Member Profile Picture
    on at

    Nobody is there to help in tracking out this error!!!!

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    best you debug the whole thing with visual studio. use menu item "attach to process ..." from menu debug. in the dialog select the windows client, internal name Microsoft.Dynamics.Nav.Client.exe.

    then open the page, which contains the field with the control-addin and start the according action. after that, the error is shown in the visual studio and the exact position, where the error occurs. for sure, it's an unhandled exception. add at that position a better exception handling (in the c# code) to get a speaking exception message, if an error occurs. check the inner exception.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans