X++ code has been compiled to Microsoft .NET Framework CIL

Hi everyone,

I am getting the below error while running a class through batch processing.

"Unable to construct an object from the class XXXXXX in the batch framework. Make sure that the X++ code has been compiled to Microsoft .NET Framework CIL, and that the constructor does not require any parameters."

But, the same class is working fine when i run it normally (not with batch processing).

Can anyone suggest me what might the problem and how can I solve this?

As the first thing, I would run full IL generation. Also follow the latter recommendation in the error message.

Thanks Martin,

But, If we run "Generate Full CIL ", it can take a long time to complete and we can’t run this frequently.

If you don’t want to run IL generation, you practically can’t develop in AX2012. If you don’t want to run it now, run it during night.

I said that this is the first thing I would try. If you have a better idea…

Thanks for reply Martin.

You can also try with Increamental IL generation, It takes less than 5 min.

I have a similar message. I have done all the suggested solutions, but still have the same error. Please advise how we can further troubleshoot this issue. The class runs fine when the output is set to screen. This error appears only when submitting the class in a batch mode.