BlogEngine.NET is setup in the root directory of my webhost (DiscountASP.NET). I am trying to setup a personal wiki in a subdirectory (www.mydomain.com/wiki).
The wiki folder is setup as a web application in IIS. www.mydomain.com/wiki shows:
Server Error in '/wiki' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'BlogEngine' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 103: </controls>
Line 104: <namespaces>
Line 105: <add namespace="BlogEngine.Core" />
Line 106: </namespaces>
Line 107: </pages>
So the webserver looks at the web.config of the root application before sending the request to the application in the subfolder. Why it can not find the bins now (which work fine when hitting www.mydomain.com), I'm not sure.
How can I setup the subfolder application so it's independent of the application installed in the root folder?
Conclusions after reading up on this: First off, If you have control over all IIS, it should be easy to set up an app in a subdirectory via App Pools and Virtual Directories.
The problem with doing it without virtual directories, and just put it in a subdirectory in the physical file system is that web.config in the subdirectory will be inheriting from the web.config in the root directory.
In some cases this can be solved by using and tags in the web.config in the subdirectory to remove the inherited things. It was a bit too arcane for my taste.
One way around this is to put all apps in separate subdirectories (/blog /wiki etc) and then use Url Rewriting on the app you want in the root directory. In my case I used the rules:
^(?!(wiki|blog)).+
and
^&
to point to /blog (appending the original query string).