I have a couple asp.net applications that run below
SubText. Since they run below this application, asp.net wants to use items from the
SubText web.config. I had this issue when running
dasBlog as well. This was causing errors in the sub-applications because the
SubText web.config uses assemblies that are not located in the sub-apps bin directory. One solution that I really wanted to avoid was to have to copy all the assemblies from the
SubText bin directory to the sub bin directories because this application is fairly simple in nature and there is no need to clutter up the directory with assemblies that it wont need.
There is an alternative to this. You can remove or even clear items added to a parent web.config from being referenced in your web.config. This is exactly what I did when I was running
dasBlog. Well I spent the good part of 2 days trying to get this same method to work with
SubText. I managed to get everything removed except a reference to system.web.extensions.dll in pages->controls. In the
MSDN documentation it states that you can use <remove tagPrefix="prefix" /> or <clear /> but attempting to do so was causing parser errors. After getting in touch with
Simone Chiaretta, he suggested that I just copy the system.web.extension.dll to the application bin directory. Although I really didn't want to have to do this, I can handle having 1 extra file. I copied the file and now the sub-applications are working.
There are a couple of sections in system.web that you have to remove items from. The first is the httpHandlers section.
<httpHandlers> <remove verb="*" path="*.asmx" /> <remove verb="*" path="*_AppService.axd" /> <remove verb="GET,HEAD" path="ScriptResource.axd" /> <remove verb="GET" path="WebResource.axd" /> <remove verb="GET" path="FtbWebResource.axd" /> <remove verb="*" path="*/images/IdenticonHandler.ashx" /> <remove verb="*" path="*CaptchaImage.ashx" /> <remove verb="*" path="OPML.aspx" /> <remove verb="*" path="MainFeed.aspx" /> <remove verb="*" path="Install/*.aspx" /> <remove verb="*" path="Providers/*/*.aspx" /> <remove verb="*" path="SystemMessages/*.aspx" /> <remove verb="*" path="HostAdmin/*.aspx" /> <remove verb="*" path="HostAdmin/*/*.aspx" /> <remove verb="*" path="Logout.aspx" /> <remove verb="GET" path="rsd.xml" /> <remove verb="GET" path="rsd.xml.ashx" /> <remove verb="*" path="*" /> </httpHandlers>
|
The next section is the httpModules
<httpModules> <remove name="SubtextAuthenticationModule"/> <remove name="InstallationCheckModule"/> <remove name="BlogRequestModule"/> <remove name="ScriptModule"/> </httpModules>
|
The last section is the assemblies defined in compliation section.
<compilation defaultLanguage="C#" debug="false"> <assemblies> <clear /> </assemblies> </compilation>
|
Since I didn't need any of the assemblies that were loaded, I can just clear this out. After all of this, the last thing to do is to copy the system.web.extensions.dll to the bin directory.