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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Method was not found during CIL generation

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have referenced a DLL in the my batch class ( extending SysOperationServiceBase). Whenever I compile the said class it works fine and also run fine when run manually from AX. But when run from schedule batch, it throws an error :

Microsoft.Dynamics.Ax.Xpp.ClrErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ClrErrorException' was thrown. 
at Microsoft.Dynamics.Ax.Xpp.CLRInterop.staticInvoke(String typeName, String methodName, Object[] parameters, Type type)

I have run the Full CIL and It gives me a warning:

CIL generation: Exception was thrown because the .NET instance method xxxx.method was not found during CIL generation in class ClassName.method. Generating the code to make a reflection call during run time.

Any help will be appreciated, thanks in Advance.

Thanks

Mallik 

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    240,073 Most Valuable Professional on at

    First of all, ensure yourself that your DLLs has been deployed to AOS.

    Then look at what type of exception it is, what's the message and if it has any inner exceptions. Knowing that your code threw "an exception" simply isn't enough.

    You might want to debug your code in X++ first and switch to CIL when it works in X++.

  • Community Member Profile Picture
    on at

    Hi Martin,

    Thanks for reply, I have deployed the DLLs in both Server and client bin folders and also the same is code is running when I run manually (with the help of a x++ job calling the Batch class job main method) and when I automated it throws an error.

    I have tried below things

    1. changed myBatch class property to run on server.

    2. copy the Dll's to all AOS servers and client bin folders.

    3. added a DLL reference to to AOT.

    Can you suggest what else can I do. Thanks in advance

  • Martin Dráb Profile Picture
    240,073 Most Valuable Professional on at

    I already did - please read my suggestion above.

    You seems to think the DLL can't be found, but that's not what the error says. It says that your code threw an exception.

  • Community Member Profile Picture
    on at

    Dear Malik,

    Not sure if this helps you, as Martin suggested here try to get the actual error message out.

    try using try catch loop and use CLRInterop::getLastException() function after catching your exception. this may tell you the actual error or problem.

    thanks,

    Manish

  • Faizan Ashraf Profile Picture
    15 on at

    May be you can check if your hot-swapping is enabled. just to to uncheck it and try again.

  • Kevin Roos Profile Picture
    265 on at

    Did you add the DLL to the server bin or in the GAC of the AOS machine?

    *edit* Didn't see there where already replies. 

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 June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans