Skip to main content What is Dynamics 365? Guided tours Customer stories Try our products CRM ERP Sales Service Sales Customer Insights Customer Service Contact Center Field Service Supply Chain Management Commerce Finance Project Operations Human Resources Business Central Pricing Business application topics Training & certifications Migrate to the cloud Documentation Events Dynamics 365 Blog Product updates Onboarding and implementation Community Find a partner Software Development Companies Partner resources Microsoft Marketplace Product documentation Technical support On-premises product support Contact us Try for free Sign in
  • 1 min read

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. One of them being:  “The resource scheduling engine uses a hard-coded resource name for jobs that do not include a resource or calendar. The hard-coded resource name is “EmptyRes”. This hard-coded name might conflict with actual resource names. There is no workaround for this issue.” The solution for this is to create a new resource: “emptyres”.

Get started with Dynamics 365

Drive more efficiency, reduce costs, and create a hyperconnected business that links people, data, and processes across your organization—enabling every team to quickly adapt and innovate.