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
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.
May be you can check if your hot-swapping is enabled. just to to uncheck it and try again.
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
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.
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
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++.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156