Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone;

I was asked to put together a few graphs for a website, and it all goes smooth on both development and pre-production environments; however, when deployed to production, all we get is a huge nothing.

Here's the web.config content (identical except for connection strings):
HTML
<configuration>

  <connectionStrings>
    <add name="GraphData" providerName="System.Data.SqlClient" connectionString="Data Source=prodServer;Initial Catalog=StatsData;User ID=xxxx;Password=xxx;" />
  </connectionStrings>

  <appSettings>
    <!--<add key="ChartImageHandler" value="storage=file; timeout=20; dir=D:\TempChartStuff\; privateImages=false;" />-->
    <add key="ChartImageHandler" value="storage=memory; timeout=20; deleteAfterServicing=true; privateImages=false;" />
  </appSettings>

  <system.webServer>

    <validation validateIntegratedModeConfiguration="false" />

    <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>

  <system.web>
    
    <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 debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
    
    <httpRuntime targetFramework="4.5"/>
    
    <pages controlRenderingCompatibilityVersion="3.5" maintainScrollPositionOnPostBack="true">
      <namespaces>
        <add namespace="System.Web.Optimization" />
      </namespaces>
      <controls>
        <add tagPrefix="webopt" namespace="Microsoft.AspNet.Web.Optimization.WebForms" assembly="Microsoft.AspNet.Web.Optimization.WebForms" />
        <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
          assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
    </pages>
    
    <authentication mode="None" />
    
  </system.web>

</configuration>

What am I missing?

What I have tried:

Deleted and re-deployed all related files.

Made sure all data sources are in fact available (pointed both: development and pre-production environments to the production data server, and data is properly being retrieved = graphs are rendered is said environments)

Verified that .NET Framework 4.0 is installed in the production server.

Changed ChartImageHandler's storage type (as seen in above code) from File to Memeroy, but has same result, everything renders in dev and pre-prod, but not in PROD.

Note that when inspecting the network traffic, the target page load all resources(200-OK code on every one) including graph images. I can only guess by the size, that they are empty.
Here are the response headers for Dev/Pre-Prod and Prod respectively:
Dev/Pre-Prod
Cache-Control:	private
Content-Length:	15387
Content-Type:	image/png
Date:		Tue, 12 Jun 2018 17:36:20 GMT
Server:		Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By:	ASP.NET


Prod
Cache-Control:	private
Content-Length:	4866
Content-Type:	image/png
Date:		Tue, 12 Jun 2018 17:38:21 GMT
Server:		Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By:	ASP.NET

Each and every suggestion is welcome. Thanks in advance!
Posted
Updated 13-Jun-18 11:40am
Comments
an0ther1 12-Jun-18 21:29pm    
Check your data - change your DB in Test environment to the Production DB or capture the Chart query using Profiler & confirm you are getting the expected data

Kind Regards
an0ther1 12-Jun-18 21:37pm    
Try changing your DB in your test environment to your Production DB or using SQL Profiler to capture your query in Production - rule out the issue is not data related

Kind Regards
alexvw 13-Jun-18 11:56am    
Hi there an0ther1,

Thank you for your input; I actually have taken that step before, but since you brought it up, I decided to check it again with a fresh mind.

For as embarrassed as I now feel, it turns out to be that production web.config file had the wrong set of credentials. As simple as that!

If you post your suggestion as answer, I will be more that happy to rate it as correct. Once again, thank you for your help.
an0ther1 13-Jun-18 17:36pm    
Thanks Alexvw, glad to be of service. I will add it as the answer

Kind Regards

1 solution

As per above comments. The issue was related to the database, in this case the Production server was using the wrong credentials.
Changing the database connection string in the test environment to point to the production db assists with troubleshooting because it rules out the 2/3 of the environment & allows for debugging, like-wise using SQL Profiler or changing the Production string to point to the test environment helps to identify where the problem is

Kind Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900