0
votes

I am working on a website built using VB.Net and ASP.Net (VS2019 .Net 4), and I am trying to add an ASP.Net Chart control, but i'm having lots of problems. My colleague has helped me with some of them, and now instead of just throwing an error it is generating the chart but isn't able to display it. I can see the image it has created on my machine, but if i right-click it on my page, and select 'Open image in new tab', i get this:

HTTP Error 500.21 - Internal Server Error Handler "ChartImg" has a bad module "ManagedPipelineHandler" in its module list

Most likely causes: Managed handler is used; however, ASP.NET is not installed or is not installed completely. There is a typographical error in the configuration for the handler module list. During application initialization, either the application initialization feature has set skipManagedModules to true, or a rewrite rule is setting a URL that maps to a managed handler and is also setting SKIP_MANAGED_MODULES=1.

Things you can try: Install ASP.NET if you are using managed handler. Ensure that the handler module's name is specified correctly. Module names are case-sensitive and use the format modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule". Ensure that any application initialization rewrite rules set SKIP_MANAGED_MODULE=0 when setting a URL that maps to a managed handler (such as .aspx, for example.) As an alternative, ensure that application initialization rewrite rules map the request to an unmanaged handler (for example, to an .htm file, which is mapped to the StaticFileHandler.)

Detailed Error Information: Module IIS Web Core Notification
ExecuteRequestHandler Handler ChartImg Error Code 0x8007000d Requested URL
http://localhost:80/WWW_TFS/GDNv1_Project/trunk-url/gDN/gDN_Support/ChartImg.axd?i=charts_0/chart_0_0.png&g=5850a0c2661a4402a1f0a33a33ec482a Physical Path
C:\WWW\WWW_TFS\GDNv1_Project\gDN\gDN_Support\ChartImg.axd Logon Method Anonymous Logon User Anonymous

After some more investigation with my colleague it looks like ChartImg.axd is missing. I've googled the issue but without any luck. Is there some kind of installation I need to do? Or can someone send me a copy of ChartImg.axd?

UPDATE: This issue is not fixed, but now i've started getting this error:

CSLLib.CSLException: Chart cannot save an item after 10 attempts. ---> System.IO.IOException: Chart cannot save an item after 10 attempts.

Everything i can see in Google suggests lack of disk space - but i have over 500GB of space left so that can't be the problem. Is there anything else that might cause this?

UPDATE: I have found that by changing the ChartImageHandler AppSetting to 'storage=memory;deleteAfterServicing=true;' the save issue goes away. The chart image is still not being displayed though.

1
Have you seen 500.21 Bad module "ManagedPipelineHandler" in its module list? (The answers with aspnet_regiis.exe. are unliekly to be the ones you want.)Andrew Morton
Is that not just for servers? I'm having the problem on my local machine. Also I tried running the command line solution but it isn't supported on my operating system (win 10 pro), and i don't see the .Net Framework in my installed apps.Colin Plater

1 Answers

1
votes

Phew! Managed to solve this myself. I wasn't setting the control up correctly, so I made these changes and it worked:

  1. Removed this from the asp.net page

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

  2. Removed all web.config settings relating to asp.net chart

  3. Removed the control from the page

  4. Dragged the control on to the page in design view

  5. Configure the chart control

  6. Added a row to AppSettings in the web.config

    key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;"

  7. Added a row to httpHandlers in web.config

    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"

Hope this helps others in the future