Troubleshooting Charts [AX 2012]
Updated: March 23, 2012
Applies To: Microsoft Dynamics AX 2012 R2
The following solutions can be helpful when you encounter problems creating Chart Controls in Enterprise Portal. For Enterprise Portal related issues, see Troubleshooting: Enterprise Portal Development.
You can debug Chart Controls for Enterprise Portal by using the Visual Studio debugger. When you start debugging, Visual Studio deploys the project files to the SharePoint server and then opens an instance of the SharePoint site in the web browser. For information about how to turn about how to debug, see Troubleshooting: Enterprise Portal Development.
The following section explains how to debug Chart Controls in Visual Studio.
To Debug a Chart Control
In Solution Explorer, right-click Default.aspx and then click Open.
Update the dynamics:AxUserControlWebPart tag so that it contains the Chart Control name to debug such as the following:
<dynamics:AxUserControlWebPart ID="AxUserControlWebPart1" runat="server" ManagedContentItem="<ChartControlName>" />
Press Ctrl+S to save changes to the Default.aspx file.
Press F5 to run the Chart Control in debug mode.
When you debug a Chart Control, you may receive the following error regarding the SharePoint sandbox.
Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=184.108.40.206, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Sharepoint.Sandbox, Version=220.127.116.11, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.
The following section explains how to resolve the error by deleting the Microsoft.SharePoint.Sandbox.dll in the Bin folder.
To Resolve the SharePoint Sandbox Error
Press F5 to run the Chart Control in debug mode. In Internet Explorer, you receive the SharePoint sandbox error. Do not close Internet Explorer.
In Solution Explorer, click the Show All Files icon.
Right click the Bin folder, and then click Open Folder in Windows Explorer.
Right-click the Microsoft.Sharepoint.Sandbox.dll file and then click Delete. Click Yes to confirm to delete the file.
In Internet Explorer, with the error displayed, press F5 to refresh the Chart Control.