It is quite comon for a Dynamics AX developer to have multiple versions of Dynamics AX Clients installed on the same PC. However when you are having Dynamics AX 4.0 Client and Dynamics AX 2009 Client installed on the same machine you can run into issues, especially when you have installed Dynamics AX 4.0 first and Dynamics AX 2009 after.

One scenario that will often fail is the deployment of Dynamics AX 2009 SSRS reports to your Microsoft SQL Server Reporting Services. For that purpose the AxReports deployment application is launched.

During the deployment process the CLRBridge DLL is loaded and unfortunately it is the CLRBride from the Dynamics AX 4.0 Client. The reason why the CLRBride from Dynamcis AX 4.0 is taken is because the BIN folder of the Dynamics AX 4.0 Client is listed in the PATH environment variable before the BIN folder of the Dynamics AX 2009 Client.

In order to fix this it is enough to simply change the order of the Dynamics AX Clients in the PATH environment variable, so the BIN folder of the Dynamics AX 2009 Client is listed before the Dynamics AX 4.0 Client.

The inability to deploy SSRS reports is however not the only scenario you can run into issues when the wrong CLRBride is loaded. I have also seen issues were the Dynamics AX 2009 Visual Studio Extensions (that are accessing the AOT) were having trouble, up to ending in a crash of the Visual Studio IDE.

A common error message showing up in the Visual Stuido IDE is:

Unable to connect to Microsoft Dynamics Ax. The Dynamics Ax Enterprise Portal Tools are not Available.

At the same time the following messages are logged in the Application event log:

Microsoft Dynamics AX Business Connector Session X.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at AxCore_CallStatic(Char* , Char* , tagVARIANT* , Int32 , tagVARIANT* )
at Microsoft.Dynamics.BusinessConnectorNet.Axapta.CallStaticClassMethod(String className, String methodName, Object[] paramList)



Dynamics Adapter CallStaticClassMethod failed.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
System.AccessViolationException
at AxCore_CallStatic(Char* , Char* , tagVARIANT* , Int32 , tagVARIANT* )
at Microsoft.Dynamics.BusinessConnectorNet.Axapta.CallStaticClassMethod(String className, String methodName, Object[] paramList)
at Microsoft.Dynamics.BusinessConnectorNet.Axapta.CallStaticClassMethod(String className, String methodName)
at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsAdapter.CallStaticClassMethod(String className, String methodName)