Add required elements to web.config to support .NET 4 Chart

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
9/3/2011 3:57:09 PM
Gravatar
Total Posts 81
Website Hobbyist and Software Engineer
Proud member of the mojoPortal team
www.doan.me

Add required elements to web.config to support .NET 4 Chart

Can you please add the following elements to the base mojoPortal web.config to support the Chart control that now ships with .NET 4?

<system.web>
    <pages>
        <controls>
            <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </controls>
        <httpHandlers>
            <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        </httpHandlers>
        <compilation>
            <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </compilation>
    </pages>
</system.web>
<system.webServer>
    <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>
</system.webServer>

Thanks for the consideration!

9/5/2011 9:20:45 AM
Gravatar
Total Posts 18439

Re: Add required elements to web.config to support .NET 4 Chart

Hi Kerry,

According to Scott Gu's blog posts here and here that stuff is declared in machine.config in .NET 4 and doesn't need to be added in Web.config.

Best,

Joe

9/5/2011 5:43:10 PM
Gravatar
Total Posts 81
Website Hobbyist and Software Engineer
Proud member of the mojoPortal team
www.doan.me

Re: Add required elements to web.config to support .NET 4 Chart

Joe,

That does not appear to be totally true...

With ASP.NET 4 you get the Chart Control, but the config entries are not in machine.config as far as I can tell, at least not on my local development environment. Right now, if I create a new web site project and look at my web.config there is really not much there except for the compilation section as expected. I add a chart control to a web form via the toolbox and then go back and view the web.config file again. The entries I reference above were automatically added to the web.config. So, it seems they have built in the feature to automatically update web.config with the required elements to support charts rather then having it in the machine.config.

Even on MSDN the example project for charts for .NET 4 comes with those entries already in the web.config. So, I assume that if MSDN even provides examples with the entries, then they are not even expecting those entires to be in the machine.config for .NET 4.

If I get a chance soon, I will try some of my charting projects on my hosting with Arvixe where I have my mojoPortal site and see if charts will run without those entries in the web.config.

Thanks!

9/7/2011 12:21:33 PM
Gravatar
Total Posts 18439

Re: Add required elements to web.config to support .NET 4 Chart

Hi Kerry,

Let me know how it goes without them, if they are really needed I'd be willing to add them, but I suspect the examples were done that way just to have consistency between the .NET 3.5 version of the examples where they would definitely be needed and the .NET 4 version. Its hard to doubt the word of Scott Gu ;-D

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.