A CLR error occurred while invoking the scheduling engine

We came across this issue recently. When running the Production Job scheduling process you experience error

“A CLR error occurred while invoking the scheduling engine.” and the exception details look like this System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation —> Microsoft.Dynamics.AX.ManagedInterop.ContainerNotValidException The Microsoft Dynamics container being referenced is not valid at Microsoft.Dynamics.AX.ManagedInterop.Container.get_Count()

The issue in this was caused by the AOS Server configuration option “Enable the hot-swapping of assemblies for each development session” being enabled on the server. This option should NOT be activated on production environments.Disabling th eoption resolved the issue However there are other causes of production job scheduling issues, and this are mentioned in the Microsoft Dynamics AX 2012 Release Notes