I was setting up a BlogEngine.Net for a local plumbing business and came across an annoying quirk. Adding the blog engine should have been pretty straight forward, drop in the blog engine folder into a website root folder, convert the folder to an application in IIS, change the virtual directory path setting in the web.config in the blog engine folder, and then the plumbing company could start blogging away.
Of course nothing is ever that easy. An error kept showing up that the theme specified within the <Pages> section ‘Theme’ property was not found from the root folders web.config settings. This error showed that the blog engine was trying to load the root folders web.config before loading the blog engine folder, which is expected even though the blog engine folder was set as a .Net 2.0 application through IIS. At that point one would wonder, how do i override or avoid loading the parent web.config settings?
Simple, surround the <system.web> setting of the blog engine folder’s web.config with a <Location> tag. Using the ‘Path’ property simply enter the name of the folder the blog engine is currently residing, and then the blog engine will automatically use only the <system.web> of the web.config found within the blog engine folder. There is also something to be said about ensuring the application pool is set to the classic setting, but that is a whole other conversation.
ASP.Net, Programming