Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

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

Posted on by Microsoft Employee

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

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

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

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

    Still Same Error exists

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

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

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

    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?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

    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.

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Exception has been thrown by the target of an invocation In NAV2015

    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?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans