I'm using URL routing (with WebForms) in the following format:
http://host/project/{projectid}/{pageName}
Another option is that the user is refering to a subapplication:
http://host/project/{projectid}/{application}/{pageName}
The subapplication isn't a new web application, simply a virtual directory.
My subapplication does have a web.config, which contains some specific appsettings/connstrings.
Everything works fine without the URL routing.
However when I request an URL in the routed form the web.config of the subapplication isn't processed and I get a null reference on all of the appsettings/connstrings (through ConfigurationManager).
Here's the code in my custom handler:
string path = String.Format(_pagesFormat, application, pageName);
return (IHttpHandler) BuildManager.CreateInstanceFromVirtualPath(path, typeof(Page));
It works if I would change my route to http://host/{application}/{projectid}/{pageName}
This probably triggers IIS to load the web.config of the virtual directory as well.
Can I somehow force the settings of the nested web.config to be loaded?
EDIT:
This person has a similar problem:
http://forums.asp.net/p/1452479/3317775.aspx
Any ideas?