“Exception has been thrown by the target of an invocation” – solved

Blogging this so that I don’t forget it yet again.

The users logged into a new AX 2012 CU3 environment, and got this error when they tried to run the Purchase Order, the bane of 2012, it would seem!

“Exception has been thrown by the target of an invocation.”

 

1-22-2013 5-01-34 PM

 

 

The fix is simple – for every user, go to “Tools > Options > Development > General” and UNCHECK the “Execute business operations in CIL” box.

 

 

1-22-2013 5-27-57 PM

 

Presto.

 

Happy DAXing!

Unknown's avatar

About janeteblake

My triple passions are Dynamics AX technical, learning, and AI
This entry was posted in AX2012, Bug, Dynamics AX. Bookmark the permalink.

16 Responses to “Exception has been thrown by the target of an invocation” – solved

  1. p.m.sudha03@gmail.com's avatar p.m.sudha03@gmail.com says:

    Hi,
    I tried this but got an error “error in getting SID”

    Like

  2. Mansoor Adeel's avatar Mansoor Adeel says:

    it worked for me, but started giving another error on PO “Voucher No. XXXX already exists”. When I check number sequences, i can’t find the number system is displaying in error! Any help

    Like

  3. Thanks a lot .. Worked for me as well

    Like

  4. Paul's avatar Paul says:

    Solebed my issue to. Thanks.

    Like

  5. Paul's avatar Paul says:

    Should have read solved rather than solebed! P

    Like

  6. Tom's avatar Tom says:

    I don’t have the the development option under tools.

    Like

    • janeteblake's avatar janeteblake says:

      Tom, thank you for mentioning that. Yes, I’ve seen that when the users were not privileged. You should get a system administrator to do it for you. Then it will work!

      Like

  7. MannyIndy's avatar MannyIndy says:

    Technically, this is not a solution. It is just a workaround that is masking the real problem. You are just bypassing the CIL compiled code. Ideally, you should trap the CLR exception and try to resolve that. Besides, as you have noted, this option is available only to users who are system admins.

    Like

  8. nick townsend's avatar nick townsend says:

    Does the message indicate there is an error in the CIL compiled code, how would you go about fixing this error correctly ?

    Like

    • janeteblake's avatar janeteblake says:

      Yes, it does indicate exactly that, and you need to resolve the code issue ultimately using normal debugging/VS debugging procedures.

      Like

      • nick townsend's avatar nick townsend says:

        Thanks for your reply Janete. I guess I’m confused as to why the code would act differently in interpreted mode than in compiled mode, it’s the same code it’s running isn’t it, just in a different way ?

        Like

  9. Alex's avatar Alex says:

    Do not do this as a solution. This basically disables functionality all over the system. You should debug and solve the actual error.

    Like

  10. Ravi Theja Madisetty's avatar Ravi Theja Madisetty says:

    Hello Jeneteblake,
    When I’m trying to open AX application immediately getting this error on screen and application is going to not responding mode. I have tried to recreate XPPIL folder, but failed (Folder partially created). Finally restarting server will resolve my issue. Seems it’s a strange error in my case.

    Thanks.,
    Ravi Theja Madisetty
    https://techguns,wordpress.com

    Like

Leave a reply to Tom Cancel reply