<?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>Purposeful Procrastination &#187; Miscellaneous</title>
	<atom:link href="http://jtnlex.com/blog/category/misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://jtnlex.com/blog</link>
	<description>It'll be useful someday, surely.</description>
	<lastBuildDate>Fri, 15 Jul 2011 04:19:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>ASP.NET sites not working</title>
		<link>http://jtnlex.com/blog/2010/06/25/asp-net-sites-not-working/</link>
		<comments>http://jtnlex.com/blog/2010/06/25/asp-net-sites-not-working/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 03:52:22 +0000</pubDate>
		<dc:creator>JT</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://jtnlex.com/blog/?p=83</guid>
		<description><![CDATA[I wasted a few hours tracking down an issue the other day where I couldn&#8217;t get an ASP.NET website running on a fresh install of Windows 7 and VS 2010. This website was running on my previous install, making it very frustrating. I spent a lot of time running through event log red herrings before [...]]]></description>
			<content:encoded><![CDATA[<p>I wasted a few hours tracking down an issue the other day where I couldn&#8217;t get an ASP.NET website running on a fresh install of Windows 7 and VS 2010. This website was running on my previous install, making it very frustrating. I spent a lot of time running through event log red herrings before coming across the real solution to my problem.</p>
<p><em>(Updated 2-Jun-2011 &#8211; see the bottom of the post for some notes on 64 bit machines)</em></p>
<p>This problem can manifest itself in a number of ways:</p>
<ul>
<li>You get an error that indicates that ASPX files are mapped to a static file handler</li>
<li>You have multiple versions of the framework installed, your site gives a 404, and you get errors/warnings in the eventlog along the lines of &#8220;<code>Unable to find schema for config section 'system.web.extensions/scripting/scriptResourceHandler'</code>&#8220;, &#8220;<code>Unknown attribute 'type'</code>&#8221; where these errors come from the <code>web.config</code> of the web application you&#8217;re trying to access.</li>
</ul>
<p>There are other possibilities for these errors, but a big possibility is that particular version of the .NET framework that your application is built to use is not registered in IIS.<strong> The most common reason for this is that you install IIS after the framework is installed.</strong> Obviously the installer can&#8217;t do the business when IIS isn&#8217;t around.</p>
<p><em>Note: you can have the correct framework selected in the IIS application pool settings, and your web.config can be perfect but you may still be experiencing this error.</em></p>
<p>IIS looked right to me, but it wasn&#8217;t finding squat. You may not see the ASP section for the website if no framework version is installed, but if say, .NET 4 is configured, and the 3.5 version that comes with 7 isn&#8217;t, your 3.5 sites will mysteriously fail. What fun!</p>
<p>The magic application that allows you to diagnose whether this problem is affecting you is aspnet_regiis.exe. This little tool is found in the framework install folder. <em>Importantly, and counter-intuitively, to check the status of a particular framework version, you need to run the executable that is specific to that version of the framework.</em> For example, to check 1.1, you need to open a command prompt and change to the <code>%windir%\Microsoft.NET\Framework\v1.1.4322</code> folder.</p>
<p>To check that the framework is installed, run the command: <code>aspnet_regiis -lv</code>.</p>
<p>To install this version of the framework, use <code>aspnet_regiis -ir</code>. This installs the framework version, but doesn&#8217;t change the settings of existing IIS application pools.</p>
<p>See the reference topic: <a title="reference link" href="http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx">ASP.NET IIS Registration Tool (Aspnet_regiis.exe)</a> on MSDN for more information.</p>
<p><strong>Update: </strong>The aspnet_iisreg tool may be in your v4.x folder. And if you&#8217;re running on a 64 bit machine, you need the version in the Framework64 folder. (Thanks to an article on <a href="http://www.hanselman.com/blog/ASPNET4BreakingChangesAndStuffToBeAwareOf.aspx">breaking changes in ASP.NET 4</a> by Scott Hanselman via <a href="http://stackoverflow.com/questions/3738559/iis-manager-cant-configure-net-compilation-on-net-4-applications/3738651#3738651">IIS Manager can&#8217;t configure .NET Compilation on .NET 4 Applications</a> on StackOverflow.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jtnlex.com/blog/2010/06/25/asp-net-sites-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

