Avkash Chauhan's Blog

Windows Azure, Windows 8, Cloud Computing, Big Data and Hadoop: All together at one place.. One problem, One solution at One time...

Adding MSCHART to your Windows azure Web Role and WCF service could cause exception

Adding MSCHART to your Windows azure Web Role and WCF service could cause exception

  • Comments 1

You might hit an exception while sdding MSCHART to your Windows azure Web Role and WCF service could cause exception as below:

  1. Create a new Windows Azure ASP.NET Webrole
  2. Add a new WCF Web Role to it
  3. Build and verify that it does works in Compute Emulator
  4. Add MsChart control on any ASP page within your Web Role
  5. Verify that web.config is updated with mschart control specific configuration
  6. Build and run it again in Compute Emulator

You will hit an exception as below:

To solve this problem you just need to add the following in your web.config inside system.webserver section:

<validation validateIntegratedModeConfiguration="false"/>

The final system.webserver looks like as below:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
Leave a Comment
  • Please add 8 and 1 and type the answer here:
  • Post
  • Can you give some background as to why the exception is thrown and the fix is necessary? You don't post issues like this about every control so I assume there is something specific about this control that is a little wonky.

Page 1 of 1 (1 items)