rss
[ Log On ]

ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution

ASP.Net Chart Control On Shared Hosting Envronment (Parser Error) - Deployment of Chart Controls On Shared Hosting Environment Properly...
3/13/2010 7:21:00 PM 60 comments 35227 times

[This Article is for those who can manage to run Chart Control on Local Server but not on Web Server]

Chart Control of ASP.Net 3.5 is very handy way to get statictical data as charts. There are variety of ways to display data with Chart Control. Also it is extramely simple to adapt it to your project. But as I hear from so many ASP.Net user nowadays, there might be some problems when it comes to publish it on your web server, especially on shared hosting servers !

After you install the Chart Control, in order to run ASP.Net chart control on your project, you need to configure your web.config file on your root directory which you have already done (I guess !). If you do that properly, you are able to run it on your local server perfectly. But it is not enough for you to be good to go on your web server.

You need to have Chart Control installed on your web server in order to run it on web !

It is easy to do that if you have your own server but for those who have their website files on a shared hosting service, it is a bit hard. But you do not need to beg your hosting provider to make it be installed on server. Only you need to do is to make proper changes on your web.config file and believe me those changes are much more simple than you think ! Of Course, some references is needed to be added to the Bin Folder on your root directory !

Solution :

  1. Follow this directory on windows explorer:

    C:\Program Files\Microsoft Chart Controls\Assemblies

  2. You will see 4 DLL files inside the folder. Two of those files are for Windows Applications and two of them for Web Applications. We need web application dll files so copy the dll files which are named 'System.Web.DataVisualization.Design' and 'System.Web.DataVisualization'

  3. Paste those dll files into the Bin folder on the root directory of your Web Application.

  4. Secondly, open the Web.Config file on the root directory of your web application.
  5. Find the <appSettings> node. You have a key add inside this just like below;

    <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />

    Replace this tag with the new one as below;

    <add key="ChartImageHandler" value="storage=file;timeout=20;"/>

    Save the changes on your Web.Config file and close it. Now copy the two dll inside the bin folder and replace the Web.Config file on your server with your new Web.Config file.


That's it !

Now you should be able to run the Chart Control on your Web Server without begging your hosting provider :) If you have any problem with this, I recommend you to check the following codes if they exist on your Web.Config file or not;

 

...



  ...

  
    
      
    
  

  ...

  
    
  

  ...



...


  
    
    
  


... 

 

Permalink Add to del.icio.usDigg!Share on FacebookShare on Google BuzzReddit!Stumble it!

Comments

gravatar
#26
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by David_677 on 03/22/10 21:23:50 Monday (UTC +00:00)
I am getting the following error. is The article related to this problem? 

Hi everybody. I installed Cahrt control of ASP:Net and It works fine on local. I made neccessary changes on web.config but When I deploy it to my site I am getting the error ! It says as below;

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 

[No relevant source lines]

Thanks in advance man !
gravatar
#27
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 03/22/10 21:37:24 Monday (UTC +00:00)
Hi David_677,

This article is entirely related to your problem and the solution complately sort your problem out !


gravatar
#28
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 03/24/10 12:06:27 Wednesday (UTC +00:00)
Also, do not forget the following refister to your page which you use As.Net Chart Control;

<%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

gravatar
#35
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by nihan on 03/31/10 18:54:54 Wednesday (UTC +00:00)
I wish you will continue your working
gravatar
#36
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 04/01/10 11:38:23 Thursday (UTC +00:00)
What a sweet of you Thanks

gravatar
#56
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 05/30/10 11:00:29 Sunday (UTC +00:00)
Asp.Net 4.0 has came with the feature of bunch chart controls. My advice is find a hosting which supports .NET Framework 4.0 and immigrate your project from ASP.Net 3.5 to ASP.Net 4.0 !

Here is a helpful link !
http://weblogs.asp.net/scottgu/archive/2010/02/07/built-in-charting-controls-vs-2010-and-net-4-series.aspx

gravatar
#60
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/21/10 14:04:39 Monday (UTC +00:00)
I immigrated my project to asp.net 4.0 only to find that the difference was the same? i.e. the chart control still registers on the asp page, the only difference being the reference having changed targeting from 3.5.0.0 to 4.0.0.0. Further the web.config is auto updated in the <appSettings> and <httphandlers> sections in the same way as before. Am I doing something wrong?
According to this guy here (see link below) I am not, it is just that MS has decided not to incorporate the chart control by default into the new framework. This due to memory concerns.
http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/973be36b-2771-41d1-b2d1-0112202cf0de
gravatar
#61
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/21/10 14:06:05 Monday (UTC +00:00)
I immigrated my project to asp.net 4.0 only to find that the difference was the same? i.e. the chart control still registers on the asp page, the only difference being the reference having changed targeting from 3.5.0.0 to 4.0.0.0. Further the web.config is auto updated in the <appSettings> and <httphandlers> sections in the same way as before. Am I doing something wrong?
According to this guy here (see link below) I am not, it is just that MS has decided not to incorporate the chart control by default into the new framework. This due to memory concerns.
http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/973be36b-2771-41d1-b2d1-0112202cf0de
gravatar
#62
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/21/10 14:07:26 Monday (UTC +00:00)
I immigrated my project to asp.net 4.0 only to find that the difference was the same? i.e. the chart control still registers on the asp page, the only difference being the reference having changed targeting from 3.5.0.0 to 4.0.0.0. Further the web.config is auto updated in the <appSettings> and <httphandlers> sections in the same way as before. Am I doing something wrong?
According to this guy here (see link below) I am not, it is just that MS has decided not to incorporate the chart control by default into the new framework. This due to memory concerns.
http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/973be36b-2771-41d1-b2d1-0112202cf0de
gravatar
#63
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/21/10 14:13:43 Monday (UTC +00:00)
Ooops, sorry about the multiple updates, they didn't show up the first few time I updated my post. Please delete the superfluous updates this note included.
gravatar
#64
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 06/21/10 14:16:46 Monday (UTC +00:00)
Hi bolsson,
Thanks for your replies but one reply is enough I guess

Here is a link for you to get a quick look at on chart control in net freamwork 4: http://www.asp.net/aspnet-4/videos/aspnet-4-quick-hit-chart-control

The exact difference is here; you do not need dll files on your bin folder if you project is under the 4 version of NET. NET Freamwork 4.0 already consists the cart control as built-in. Of course if your hosting firm supports 4.0 version !

Also you will see in my previous post tha there is a link from Scott Guthrie's blog. please review this post;
http://weblogs.asp.net/scottgu/archive/2010/02/07/built-in-charting-controls-vs-2010-and-net-4-series.aspx

gravatar
#65
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/21/10 14:19:53 Monday (UTC +00:00)
I am having troubles with a broken chart control link at my new host PowerDNN. my setup is as follows, default chart property settings on the asp page, thus the httphandler in web.config should handle the chart.

It seems that no matter what changes i make to my web.config <appsetting> section on the host server I still get the same image link on the HTML page (see below).

<img id="dnn_ctr418_ViewQuestionnaire_Chart1" src="//temp/ChartPic_000001.png?c4446b47-99ea-4dea-8bbc-d2599f46d4e3" alt="" usemap="#dnn_ctr418_ViewQuestionnaire_Chart1ImageMap" style="height:440px;width:500px;border-width:0px;">

I have no clue what is going on. On my localhost everything works fine???
gravatar
#66
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 06/21/10 14:24:05 Monday (UTC +00:00)
On your computer, I mean at t-your local host, everything works perfect because you have installed chart control into your computer before but not in your shared hosting. That's why we are doing those changes. Please be sure you did everything as above and below one especially;

  1. Follow this directory on windows explorer:

    C:\Program Files\Microsoft Chart Controls\Assemblies

  2. You will see 4 DLL files inside the folder. Two of those files are for Windows Applications and two of them for Web Applications. We need web application dll files so copy the dll files which are named 'System.Web.DataVisualization.Design' and 'System.Web.DataVisualization'

  3. Paste those dll files into the Bin folder on the root directory of your Web Application.


gravatar
#67
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/22/10 0:21:20 Tuesday (UTC +00:00)
Hi again Tugberk,

Thanks a lot for your input.

I already did copy the two .dll files to the bin folder. Before I did that the chart control gave an error.
Now it does not give an error, just a broken image. When I examine the image and its link with the Google Developer Tools i get the info stated in the above post, i.e the image tag.

And in fact when i check the temp folder at my host I find the newly created Chartpic_000001.png file.
So the image is created correctly and stored in my temp folder.
The image tag that the chart control generates is not correct however. 

My <AppSettings> section of the web.config file states:
<add key="ChartImageHandler" value="storage=file;timeout=20;" />

I have tried changing the storage value to point to memory or the temp folder, but to no avail, the image tag generated is still the same, i.e. src="//temp/ChartPic_000001.png.
I believe it should have been src="/temp/ChartPic_000001.png with only one slash.
Why is the <httphandler> ignored. In my asp code I use default properties in my <asp:chart> tag in order to have the httphandler handle the chart generation.

Is my explanation clear I wonder :-)
By now my hairs are turning gray.
Wondering if it could be a caching issue at my host server?

gravatar
#68
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 06/22/10 8:59:15 Tuesday (UTC +00:00)
bolsson, generate your chart and after that go to your source code in your brpwser. find your chart's image and its src should like that;

src
="/ChartImg.axd?i=chart_0_0.png&amp;g=18a2dd14dae047ce87328198e37e4dcb"

It is not like that in your code as far as I got from you.

gravatar
#69
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 06/22/10 9:19:29 Tuesday (UTC +00:00)
bolsson,

Also please have a look at this comment of mine which is important

gravatar
#70
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by coklow on 06/22/10 13:10:25 Tuesday (UTC +00:00)
Definately imigrate your project to asp.net 4 version if you wanna use charts in a shared hosting ! Aslo it is so easy to use it in Visual Studio 2010 !

gravatar
#71
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by bolsson on 06/22/10 15:07:33 Tuesday (UTC +00:00)
Hi again Tugberk,

Thanks a lot for your help.
As it turns out I had set the imagestoragemode property of the chart to UseImageLocation in my code behind: Chart1.ImageStorageMode = DataVisualization.Charting.ImageStorageMode.UseImageLocation and forgotten all about it.
Changing the imagelocation from:
                Chart1.ImageLocation = Request.ApplicationPath "/temp/ChartPic_#SEQ(300,3)"
To:
                Chart1.ImageLocation = "~/temp/ChartPic_#SEQ(300,3)"

sorted out the problem.

Silliness = waste of everybodies time.
Thanks for your eyes.

gravatar
#72
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 06/22/10 15:15:02 Tuesday (UTC +00:00)
I thought you have done that already :) It might be something like that;

imagetype="Png" ImageLocation="~\TempImages\ChartPic_#SEQ(300,3)"

gravatar
#74
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by aliasgar on 07/07/10 10:59:08 Wednesday (UTC +00:00)
Hello
I tried your way but i am still getting this error

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

Source File: C:\inetpub\wwwroot\qassemhamada.com\wwwroot\khcampaign\web.config    Line: 58

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082

gravatar
#75
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by aliasgar on 07/07/10 10:59:42 Wednesday (UTC +00:00)
Please help me in this as soon as possible..

gravatar
#76
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 07/07/10 11:07:01 Wednesday (UTC +00:00)
aliasgar,

Please Click Here to read this review. be sure you do that already. it seems you do not !

gravatar
#77
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by aliasgar on 07/07/10 11:47:41 Wednesday (UTC +00:00)
I have already added .dll files of MS chart control in my bin.

Check my web config

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
    <appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;"/>
  </appSettings>
    <connectionStrings>
       

    </connectionStrings>
    <!--<pages enableEventValidation="true"/> -->
    <system.web>
    <pages>
       <controls>
          <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
         <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
       </controls>
     </pages>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true">
            <assemblies>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <httpHandlers>
      <add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
      <!--<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>-->
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
        <!--authentication mode="Windows"/>-->
        <!--The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>-->
        <customErrors mode="Off">
        </customErrors>
    </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
        type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd"
        preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD"
        path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <remove name="ChartImageHandler"/>
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </handlers>
  </system.webServer>
    <system.net>
     
    </system.net>
</configuration>


gravatar
#78
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 07/07/10 11:55:40 Wednesday (UTC +00:00)
the problem is wit your dll files. nothing wrong with your web.config file. be sure that the dll files were healthly passed to server.

gravatar
#79
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by aliasgar on 07/07/10 12:12:43 Wednesday (UTC +00:00)
it says this
Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

gravatar
#80
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by aliasgar on 07/07/10 12:14:06 Wednesday (UTC +00:00)
sorry i have posted wrong
    <assemblies>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>

This is in my web config

gravatar
#81
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 07/07/10 12:19:13 Wednesday (UTC +00:00)
That's what I say ! the problem is with your assembly. delete them on your server, an upload them again be sure that you have added the right ones into your bin folder. be through ! do not overlook anything. It still doesn't work, contact with your hosting firm.

gravatar
#82
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 07/07/10 12:23:52 Wednesday (UTC +00:00)
here it is ! I figured out now;

remove this from your assembleis;

<add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

I should work after that

gravatar
#83
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by aliasgar on 07/07/10 12:27:56 Wednesday (UTC +00:00)
i have remove that assemblies but now it is giving me this error

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

[No relevant source lines]

Source File: none    Line: 0

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082


gravatar
#90
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by walter on 08/07/10 11:15:14 Saturday (UTC +00:00)
Use Asp.NET 4.0 for chart control. it is so much easier
gravatar
#108
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Mehmet on 11/24/10 23:14:37 Wednesday (UTC +00:00)
Çözüm için teşekkür ederim eline sağlık. Çok faydalı oldu bu yazı. Kolay gelsin.
gravatar
#109
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Mehmet on 11/24/10 23:24:51 Wednesday (UTC +00:00)
By the way I suppose that everyone who apply this solution would have some problems about permissions of chart images that needs a temparory file. Here is the solution:

Chance the code line at the web.config by that:

<

add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\windows\temp\;"/>
gravatar
#110
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 11/25/10 10:37:05 Thursday (UTC +00:00)
hi mehmet,

no problem. But consider immigrating your application from 3.5 to 4.0 You will see that chart control won't be a problem on asp.net 4.0. BTW, thanks for the patch. The problem is related to your server. the code works just fine for me on my shared hosting account.
gravatar
#120
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by eth on 12/10/10 3:55:10 Friday (UTC +00:00)
thanks for this post! you solved my problem.. :D
gravatar
#128
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 12/11/10 14:01:21 Saturday (UTC +00:00)
thanks for this post! you solved my problem.. :D

I'm glad it helped...
gravatar
#2068
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by nihan on 02/15/11 22:29:57 Tuesday (UTC +00:00)

great article :))


gravatar
#2075
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by D1 on 02/28/11 8:49:16 Monday (UTC +00:00)

u r gr8 guy, worked perfectly


gravatar
#2076
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by D1 on 02/28/11 8:50:16 Monday (UTC +00:00)

u r gr8 guy, worked perfectly


gravatar
#2077
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 02/28/11 11:10:39 Monday (UTC +00:00)

@D1 that's your greatness man :)


gravatar
#2078
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by kamal on 03/01/11 11:30:08 Tuesday (UTC +00:00)

i got an error '

The temp directory in chart handler configuration is not accessible [D:\Hosting\7476079\html\].'

can you fixed the problem ?

 

thanks 

kamal

 


gravatar
#2079
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 03/01/11 17:10:25 Tuesday (UTC +00:00)

@kamal did you check that you have write access on  the directory?


gravatar
#2080
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by kamal on 03/03/11 6:25:13 Thursday (UTC +00:00)

i did give write access on the directory, and now i got another error error like below :

Server Error in '/' Application.

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. 

Exception Details: System.Security.SecurityException: Request failed.

Source Error: 

 

[No relevant source lines]

 

can you help me?


gravatar
#2081
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 03/03/11 10:49:57 Thursday (UTC +00:00)

This is releated to your trust level. Please check : http://msdn.microsoft.com/en-us/library/wyts434y.aspx

but this is a tricky part. you could be vaulnerable after that.


gravatar
#2089
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Shyamal Bhowmik on 03/23/11 23:30:24 Wednesday (UTC +00:00)

Hi,

 

Thanks for this helpful post. I tried all the options mentioned here to configure the chart control to work on my shared environment. But the chart image is not displayed. I need to understand whether the ASPNET user needs explicit permission to write on the folder where the image for the chart will be stored temporarliy. Any help in this direction will be very much helpful.

 

TIA

Shyamal Bhowmik


gravatar
#2091
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 03/24/11 0:35:23 Thursday (UTC +00:00)

@Bhowmik

please make use that your chart control has the properties as below;

imagetype="Png" ImageLocation="~\TempImages\ChartPic_#SEQ(300,3)"

and check the appSetting Key whose name ChartImageHandler and it should contain the values like below;

<add key="ChartImageHandler" value="storage=file;timeout=20;"/>

Also, the problem could releate to your hosting provider. you should try to contact them and inform about the situation if it is not working after you do everthing by the book.


gravatar
#2094
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Shyamal Bhowmik on 03/24/11 4:58:04 Thursday (UTC +00:00)

Hi TugBerk,

 

Thanks for the quick response. I o have all those properties set on my code following your post. I would like to know if the ASPNET user on the webserver needs write permission to that TempImages folder in the application root directory to write the generated chart images? In my case it doesnot have. I wanted to make sure this is the reason for not getting the chart displayed. Please let me know.

 

TIA

Shyamal Bhowmik


gravatar
#2095
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 03/24/11 10:53:52 Thursday (UTC +00:00)

@Bhowmik

give the write permission to temp folder for IIS_WPG and NETWORK SERVICE and try again.


gravatar
#2108
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Jibran on 05/02/11 19:07:33 Monday (UTC +00:00)

hank you very much for your article.

it helped me a lot.

But after making advised changes, i got the error which says something like "asp.net needs does not have the write access... " but I couldn't grant rights as it is shared free hosting.

then i again googled and found one comment very useful in the following thread: http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/92238582-9445-4d15-a5a7-5f24fd4bf646/ 

 

thanks again for your help.

 

keep up the good work...

 

 


gravatar
#2109
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by tugberk on 05/02/11 20:37:37 Monday (UTC +00:00)

@jibran thanks. happy that it helped. please also see the 5th item on the solution list above on the post. It gives you the config changes in order not to deal with write access.


gravatar
#2110
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Daniel on 05/08/11 0:53:04 Sunday (UTC +00:00)

 

I am trying to use the microsoft Charting control on a shared server and have inserted the following:  

<add key="ChartImageHandler" value="Storage=file;Timeout=20;url=~/temporary/;"/>

 

 

And in the webpage I have:

Chart1.ImageStorageMode = ImageStorageMode.UseImageLocation;

Chart1.ImageLocation = "~/temporary/ChartPic_#SEQ(300,3)";

Chart1.ImageType = ChartImageType.Png;

 

on the aspx page:

<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

 

Please help as i am very stuck and getting frustrated that this doesnt work.

 


gravatar
#2111
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Tugberk on 05/08/11 23:29:26 Sunday (UTC +00:00)

@Daniel

what is the error you are getting?

try to replace <add key="ChartImageHandler" value="Storage=file;Timeout=20;url=~/temporary/;"/> with <add key="ChartImageHandler" value="storage=file;timeout=20;"/>

and also replace Chart1.ImageLocation = "~/temporary/ChartPic_#SEQ(300,3)"; with Chart1.ImageLocation = "~\TempImages\ChartPic_#SEQ(300,3)";

 


gravatar
#2112
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Daniel on 05/09/11 20:53:35 Monday (UTC +00:00)

If i replace <add key="ChartImageHandler" value="Storage=file;Timeout=20;url=~/temporary/;"/> with <add key="ChartImageHandler" value="storage=file;timeout=20;"/>

 

I get an error sta ting:

The temp directory in chart handler configuration is not accessible [D:\Hosting\7796030\html\]

I think because its on a shared server.  Thats why i created a new folder named "temporary" with full read and write permissions and pointed the chart image location to that folder with the previous tag <add key="ChartImageHandler" value="Storage=file;Timeout=20;url=~/temporary/;"/>.  

 

The overall problem:

The problem I am getting is that if i point the chart image location to the folder i created named "temporary", it does not produce the graph image instead it produces an empty image with only a title.  I also believe I have the correct dlls in my bin folder,  'System.Web.DataVisualization.Design' and 'System.Web.DataVisualization'.

 


gravatar
#2134
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by JM Belmonte on 06/01/11 3:52:26 Wednesday (UTC +00:00)

Nice job dude . . .


gravatar
#2143
Beale AFB Self Storage
by erleroadself on 06/21/11 9:02:30 Tuesday (UTC +00:00)


Thank you for making the effort and spreading this information with all of us. It was indeed very useful and informative while being straight forward and to the point.


gravatar
#2152
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by ishtiyaq on 06/29/11 3:53:24 Wednesday (UTC +00:00)

about the charting control. Still have the same problem after following the direction on the forum. My web config wont work on godaddy server. Please help me.


gravatar
#2300
why does it save a copy of the chart as a png to it's folder
by George on 01/11/12 21:50:37 Wednesday (UTC +00:00)

When I run the page that holds my charts, a copy of the chart is saved as a png file. Obviously I can't let this keep on happening! could you point me to the code or attribute that's doing this?  Incidentally you blog is great, it helped me out of a great hole.


gravatar
#2347
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by anders on 02/14/12 12:46:08 Tuesday (UTC +00:00)

Hi,
I'm running vs 2010 and are using the chart control. My public server runs 3.5 and hence I've trouble with the chart control..
I've follwed your guide but I get the following error message:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 34:         <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 35:         <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 36:         <add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 37:         <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 38:       </assemblies>

Source File: \\172.21.204.204\webvol18\np\0kqf3r1zmk1un31\andersmarcusson.com\public_html\website7\web.config    Line: 36

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634


When i remove the datavisualization line (assembly) from the web.config file and restart the web server I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'WebApplication21.WebForm1'.

Source Error:


Line 1:  <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication21.WebForm1" %>
Line 2: 
Line 3:  <%@ Register assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

Source File: /website7/webform1.aspx    Line: 1


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634


I'm lookign forward to your reply.
Best regards
Anders


gravatar
#2529
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by snehith on 06/11/12 22:46:35 Monday (UTC +00:00)

Hi i made the changes as yo said and now i am not getting run time error but when i try to view my chart page i am being asked authentication required page??May i know why i am getting this page.I also tried to login with username and password but it couldnt login and when i click cancel iam getting this msg

You are not authorized to view this page

You do not have permission to view this directory or page using the credentials that you supplied.

Please try the following:

  • Contact the Web site administrator if you believe you should be able to view this directory or page.
  • Click the Refresh button to try again with different credentials.

HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
Internet Information Services (IIS)


Technical Information (for support personnel)

  • Go to Microsoft Product Support Services and perform a title search for the words HTTP and 401.
  • Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled AuthenticationAccess Control, and About Custom Error Messages.


gravatar
#2653
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Zodiaxx on 09/26/12 7:50:54 Wednesday (UTC +00:00)

Hi,i used .NET 4.0, and created my chart in VS 2010. i have followed all the instructions above but when i try to display my chart, i get the error:

------------------------------------------------------------

Compiler Error Message: CS0433: The type 'System.Web.UI.DataVisualization.Charting.DataPoint' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.DataVisualization\3.5.0.0__31bf3856ad364e35\System.Web.DataVisualization.dll' and 'c:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System.Web.DataVisualization\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DataVisualization.dll'

Source Error:

Line 505:        

Line 506:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]

Line 507:        private global::System.Web.UI.DataVisualization.Charting.DataPoint @__BuildControl__control8() {

Line 508:            global::System.Web.UI.DataVisualization.Charting.DataPoint @__ctrl;

----------------------------------------

please help out.


gravatar
#2886
re: ASP.Net Chart Control On Shared Hosting Environment, Chartimagehandler / Parser Error Problem Solution
by Waqas Chaudhry on 04/26/13 14:27:17 Friday (UTC +00:00)

This is a very help ful tutorial, it has solved my problem. Thanks a lot for sharing such a helpful material.



Additional allowed tags : [quote]...[/quote], [user]...[/user]
:
:
: will not be displayed ! (but will show your Gravatar)
:
: