The GTANETPRO group has recently decided to host their own web site. Originally, the site was hosted through a provider and cost about $150 per year to host. I had a Pentium 3 lying around and said why not host it ourselves at minimal cost. This server was already hosting my now obsolete blog and porting the GTANETPRO site should be simple enough. The GTANETPRO site uses DotNetNuke (DNN) so all that was needed was an XCOPY and a restore of the DNN database. Simple enough and it was, we had the site up and running within one hour.
I decided to make GTANETPRO the root application and have my existing sites as child applications. I agree, this perhaps, is not the ideal configuration but nonetheless this was how I did it. When I browsed to my obsolete blog I got the following exception:
Parse Error Message: The code subdirectory '/blog/App_Code/HTML/' does not exist.
Clearly, this was not an issue with the blog application as it did not require the App_Code/HTML directory. In fact, the blog application uses the Web Application project template and does not have an App_Code directory. It must be DotNetNuke's web.config that is the issue. Remember child ASP.NET sites inherit their parent web.config settings.
I did some Googling and found a number of postings where DNN sites where having similar problems. Finally, I found a post that was not DNN specific but had the same problem. The solution was to make a small change to the parent's web.config so that config settings where not sent to the child sites.
The following markup shows how to prevent a child ASP.NET from inheriting a portion of the parent's web.config.
<location inheritInChildApplications="false">
<!-- The stuff in here will not be sent to the child sites. -->
</location>
In my particular case, I surrounded the existing <system.web> section as this contained the HTTP Modules that were causing the exception.
Please note that not all sections can be placed within the <location> tags. For example, if you place the <runtime> section with the above location tags you will get an exception.
Guess the movie
You have the ring, and I see your Schwartz is as big as mine. Let's see how well you handle it.