<?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>Shawson&#039;s Code Blog &#187; asp.net</title>
	<atom:link href="http://codeblog.shawson.co.uk/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeblog.shawson.co.uk</link>
	<description>development notes for my failing memory</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:00:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders</title>
		<link>http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/</link>
		<comments>http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 10:01:26 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=372</guid>
		<description><![CDATA[We recently had an issue setting a .net microsite live off the back of an existing domain, hosting another .net site. This was due to the web.config being inherited to the child- we would be hit with errors like this; Configuration Error Description: An error occurred during the processing of a configuration file required to [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-404-3-errors/' rel='bookmark' title='WCF 404.3 Errors'>WCF 404.3 Errors</a></li>
<li><a href='http://codeblog.shawson.co.uk/referencing-custom-properties-on-a-master-page-from-the-child-page/' rel='bookmark' title='Referencing custom properties on a Master page from the Child page'>Referencing custom properties on a Master page from the Child page</a></li>
<li><a href='http://codeblog.shawson.co.uk/iis-express-hanging-when-launched-from-visual-studio/' rel='bookmark' title='IIS Express hanging when launched from visual studio'>IIS Express hanging when launched from visual studio</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>We recently had an issue setting a .net microsite live off the back of an existing domain, hosting another .net site.</p>
<p>This was due to the web.config being inherited to the child- we would be hit with errors like this;</p>
<blockquote><p><span></p>
<h2><em>Configuration Error</em></h2>
<p></span> <span style="font-family: Arial,Helvetica,Geneva,SunSans-Regular,sans-serif;"> <strong> Description: </strong>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.</p>
<p><strong> Parser Error Message: </strong>Could not load file or assembly &#8216;UrlRewritingNet.UrlRewriter&#8217; or one of its dependencies. The system cannot find the file specified. (d:ProjectsVSAspDotNetFaqProjectWebsiteweb.config line 89)</p>
<p><strong>Source Error:</strong></p>
<p></span></p>
<table style="width: 600px;display:block;" border="0" bgcolor="#ffffcc">
<tbody>
<tr>
<td>
<pre style="width:600px;">Line 88: &lt;httpModules&gt;
<span style="color: red;">Line 89:   &lt;add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule,
      UrlRewritingNet.UrlRewriter"/&gt;
</span>Line 90:   &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
          System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
Line 91: &lt;/httpModules&gt;</pre>
</td>
</tr>
</tbody>
</table>
</blockquote>
<p>This is because a module was defined in the parent site which doesn&#8217;t exist in the child, but because it&#8217;s inheriting it still tries to load it.  We would also get errors complaining that modules have already been defined.</p>
<p>I tried initially, manually adding &lt;remove name=&#8221;blah&#8221; /&gt; to the child web.config to remove the entries in the child web.config it thought were defined twice, but after putting in about 10 of these and it still not working it started to get a bit ridiculous!</p>
<p>The trick, we found on google (<a href="http://www.aspdotnetfaq.com/Faq/how-to-disable-web-config-inheritance-for-child-applications-in-subfolders-in-asp-net.aspx">How to disable web.config Inheritance for Child Applications in Subfolders in ASP.NET?</a>) is to stop the web.config from inheriting in the top level web.config;</p>
<p style="margin: 0px;"><span style="color: blue;"> &lt;</span><span style="color: #a31515;">location</span><span style="color: blue;"> </span><span style="color: red;">path</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">.</span>&#8220;<span style="color: blue;"> </span><span style="color: red;">inheritInChildApplications</span><span style="color: blue;">=</span>&#8220;<span style="color: blue;">false</span>&#8220;<span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;"> &lt;</span><span style="color: #a31515;">system.web</span><span style="color: blue;">&gt;<br />
&#8230;<br />
</span> <!--  {rtf1ansiansicpglang1024noproof65001uc1 deff0{fonttbl{f0fnilfcharset0fprq1 Courier New;}}{colortbl;??red0green0blue255;red255green255blue255;red163green21blue21;red255green0blue0;red0green0blue0;}??fs20 cf1       &lt;cf3 httpModulescf1 &gt;par ??        &lt;cf3 addcf1  cf4 namecf1 =cf0 "cf1 UrlRewriteModulecf0 "cf1  cf4 typecf1 =cf0 "cf1 UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewritercf0 "cf1 /&gt;par ??        &lt;cf3 addcf1  cf4 namecf1 =cf0 "cf1 ScriptModulecf0 "cf1  cf4 typecf1 =cf0 "cf1 System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35cf0 "cf1 /&gt;par ??      &lt;/cf3 httpModulescf1 &gt;}  --></p>
<p><!--  {rtf1ansiansicpglang1024noproof65001uc1 deff0{fonttbl{f0fnilfcharset0fprq1 Courier New;}}{colortbl;??red0green0blue255;red255green255blue255;red163green21blue21;red255green0blue0;red0green0blue0;}??fs20 cf1   &lt;cf3 locationcf1  cf4 pathcf1 =cf0 "cf1 .cf0 "cf1  cf4 inheritInChildApplicationscf1 =cf0 "cf1 falsecf0 "cf1 &gt;par ??    &lt;cf3 system.webcf1 &gt;}  --><span style="color: blue;"> &lt;/</span><span style="color: #a31515;">system.web</span><span style="color: blue;">&gt;</span> <span style="color: blue;"><br />
&lt;</span><span style="color: #a31515;">/location&gt;</span></p>
<p>This stops anything being migrated down to the children, allowing you to have your full web.config in the child site, unaffected by the parent! &#8212; Make sure you don&#8217;t put this around anything else though; <strong>just the system.web section!</strong></p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-404-3-errors/' rel='bookmark' title='WCF 404.3 Errors'>WCF 404.3 Errors</a></li>
<li><a href='http://codeblog.shawson.co.uk/referencing-custom-properties-on-a-master-page-from-the-child-page/' rel='bookmark' title='Referencing custom properties on a Master page from the Child page'>Referencing custom properties on a Master page from the Child page</a></li>
<li><a href='http://codeblog.shawson.co.uk/iis-express-hanging-when-launched-from-visual-studio/' rel='bookmark' title='IIS Express hanging when launched from visual studio'>IIS Express hanging when launched from visual studio</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

