Friday, November 6, 2009

Disabling web.config inheritance for child application

Error:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'Control' or one of its dependencies. The system cannot find the file specified. (d:\Web\VS\Website\web.config line 82)

Source Error:

Line 77: <httphandlers>
Line 78: <remove path="*.asmx" verb="*">
Line 79: <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false">
Line 80: <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false">
Line 81: <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false">
Line 82: <add path="SecurityImageHandler.ashx" verb="*" type="Control.SecurityImageControlHandler, Control">
Line 83: </httphandlers>



Solution:
I have an application which has a child (sub folder) application in it. In my case, I added a tag in the parent application:

<add path="SecurityImageHandler.ashx" verb="*" type="Control.SecurityImageControlHandler, Control">



When deployed, an error occurs in the child application, since the assembly added in the parent application is also recognized by the child application. To avoid the child application from reading the tag added on the parent application, we have to remove the tag on the web.config of the child application.

After adding the code to remove the tag, it will look like this:

<httpHandlers>
...........
...........
<remove verb="*" path="SecurityImageHandler.ashx"/>
...........
...........


Share:

1 comment:

  1. keep up the good work.. i appreciate the content u put in.

    ReplyDelete

About

Related Posts

Frame cannot Load - Content Security Policy Issue

Problem: You are using iframe to load a site from within a website, and the frame does not load. In my case, I am using https for both the...

About Me

My photo
Is an ordinary unNoticed man, with a little knowledge to share and high dreams to achieve. I'd be glad if I can help others, 'coz the only thing for the triumph of evil is for a good man to do nothing. I like English and Chinese language, and know a little about them. Hence, for me, most things can best be expressed in Chinese, some in English, and the rest in others ^^

About Blog

You can find a lot of debugging and deploying problems while developing applications in .NET and Visual Basic here. There are also some querying tips in SQL and typical source codes which might be useful shared here.

Popular Posts

Blogroll

Followers

Follow by Email