<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ASP.NET Chart Control &#8211; Tjitjing Blog</title>
	<atom:link href="http://localhost/index.php/tag/asp-net-chart-control/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.tjitjing.com/</link>
	<description>This is my blog on technology related stuff and on occation other things too...</description>
	<lastBuildDate>Mon, 28 Jun 2010 21:41:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.16</generator>
	<item>
		<title>ASP.NET 4.0 Chart Control Problems on IIS7</title>
		<link>https://blog.tjitjing.com/index.php/2010/06/asp-net-4-0-chart-control-problems-on-iis7.html</link>
					<comments>https://blog.tjitjing.com/index.php/2010/06/asp-net-4-0-chart-control-problems-on-iis7.html#comments</comments>
		
		<dc:creator><![CDATA[Max]]></dc:creator>
		<pubDate>Mon, 28 Jun 2010 21:41:34 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[.NET Framework 4.0]]></category>
		<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[ASP.NET Chart Control]]></category>
		<category><![CDATA[ASP.NET Routing]]></category>
		<category><![CDATA[IIS7]]></category>
		<guid isPermaLink="false">http://blog.tjitjing.com/?p=270</guid>

					<description><![CDATA[I have been playing around with the ASP.NET 4.0 Chart Controls for a new web site (Bilvärdet.se &#8211; used car price statistics) When deploying it to IIS7 on my Windows Server 2008 I ran in to a few problems: 1) I did not have .NET 4.0 Framework installed on the server 🙂 It turns out&#8230; <a class="more-link" href="https://blog.tjitjing.com/index.php/2010/06/asp-net-4-0-chart-control-problems-on-iis7.html">Continue reading <span class="screen-reader-text">ASP.NET 4.0 Chart Control Problems on IIS7</span></a>]]></description>
										<content:encoded><![CDATA[<p>I have been playing around with <strong>the <a href="http://code.msdn.microsoft.com/mschart" target="_blank" rel="noopener noreferrer">ASP.NET 4.0 Chart Controls</a></strong> for a new web site (<a href="http://www.bilvardet.se/" target="_blank" rel="noopener noreferrer">Bilvärdet.se &#8211; used car price statistics</a>)</p>
<p>When deploying it to IIS7 on my Windows Server 2008 I ran in to a few problems:</p>
<h3>1) <strong>I did not have .NET 4.0 Framework installed on the server</strong></h3>
<p><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> It turns out <a href="http://en.wikipedia.org/wiki/.NET_Framework" target="_blank" rel="noopener noreferrer">.NET 4.0 Framework</a> is an optional update in Windows Update and for some reason that I could not figure out failed to install (error code: 80200053) Solution that worked: <a href="http://www.microsoft.com/web/gallery/install.aspx?appid=NETFramework4" target="_blank" rel="noopener noreferrer">Manually installed it</a>. I had to use a tool that was new to me, <a href="http://www.microsoft.com/web/" target="_blank" rel="noopener noreferrer">the Microsoft Web Platform Installer (Web PI)</a>. Seems to be a cool tool to download, install and configure all sorts of software (incl WordPress, Dupral, Joomla) on Windows, will check this out in more detail in the future.<br />
Don&#8217;t forget to change the Application Pool for your Web Site/Web Application in IIS Manager to use .NET Framework 4.0</p>
<h3>2) Next problem, error message: <strong>An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode</strong></h3>
<p>This turned out to be a few lines of code in web.config that seems to be needed on my development machine (Windows7 and Visual Studio 2010) but causes problems on IIS7.</p>
<p>Just removed this section from production web.config on server and it worked:</p>
<p>[code lang=&#8221;xml&#8221;]&lt;httpHandlers&gt;<br />
     &lt;add path=&quot;ChartImg.axd&quot; verb=&quot;GET,HEAD,POST&quot;<br />
     type=&quot;System.Web.UI.DataVisualization.Charting.ChartHttpHandler,<br />
     System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral,<br />
     PublicKeyToken=31bf3856ad364e35&quot; validate=&quot;false&quot;/&gt;<br />
&lt;/httpHandlers&gt; [/code]</p>
<p>Thanks to <a href="http://mnarinsky.blogspot.com/2010/06/aspnet-40-chart-control-breaks-iis-70.html" target="_blank" rel="noopener noreferrer">Michael Narinsky</a> for pointing this out.</p>
<h3>3) Image file directory problems</h3>
<p><strong>First error message: Invalid temp directory in chart handler configuration c:\TempImageFiles\ </strong></p>
<p>Solution: Changed dir in ChartImageHandler app settings in web.config</p>
<p>[code lang=&#8221;xml&#8221;]&lt;appSettings&gt;<br />
     &lt;add key=&quot;ChartImageHandler&quot; value=&quot;storage=file;timeout=20;dir=c:\TempImageFiles\;&quot;/&gt;<br />
&lt;/appSettings&gt; [/code]</p>
<p><strong>Then this error message: The temp directory in chart handler configuration is not accessible</strong><strong> c:\xxx\images\</strong></p>
<p>Followed error message suggestion and added access rights to directory (Properties &#8211; Security tab) for user NETWORK SERVICE</p>
<p><em>[Update: Other error message that can appear:<br />
a) &#8220;Access to the path &#8216;C:\xxx\images\charts\chart.png&#8217; is denied.&#8221; &#8211; this is the same as above, add rights for NETWORK SERVICE<br />
b) &#8220;Could not find a part of the path &#8216;C:\xxx\images\charts\chart.png&#8217;.&#8221;  &#8211; make sure directory exists or create it]<br />
</em></p>
<h3>4) Charts not rendering with ASP.NET Routing</h3>
<p>I&#8217;m using <a href="http://msdn.microsoft.com/en-us/library/cc668201.aspx" target="_blank" rel="noopener noreferrer">ASP.NET 4.0 Routing</a> but this seems to be something Charts are not working well with. Charts are showing up as broken links. If you are using routing, you need to make sure ChartImg.axd is ignored. Add Ignore (or IgnoreRoute) and &#8211; this took me quite some time to figure out &#8211; make sure you add these before any MapPageRoute or it will not work!</p>
<p>This is what I added in VB.NET, add one line per level in virtual/route folder structure &#8211; first line is for root, second line for one subdirectory level, third line for two subdirectory levels.</p>
<p>[code lang=&#8221;vb&#8221;]routes.Ignore(&quot;ChartImg.axd/{*pathInfo}&quot;)<br />
routes.Ignore(&quot;{controller}/ChartImg.axd/{*pathInfo}&quot;)<br />
routes.Ignore(&quot;{controller}/{action}/ChartImg.axd/{*pathInfo}&quot;)[/code]</p>
<p><a href="http://stackoverflow.com/questions/319835/new-asp-net-charting-controls-will-they-work-with-mvc-eventually" target="_blank" rel="noopener noreferrer">Thanks to Simon Steele</a>.</p>
<p>BTW &#8211; <a href="http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx" target="_blank" rel="noopener noreferrer">Another nice link about ASP.NET Chart Control</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.tjitjing.com/index.php/2010/06/asp-net-4-0-chart-control-problems-on-iis7.html/feed</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
	</channel>
</rss>
