开发者

Asp.net 4.0 child application does not work on IIS 7.5?

开发者 https://www.devze.com 2023-01-04 01:31 出处:网络
I have a Website on IIS 7.5 configured as shown below. ParentWebSite ---ChildWebApp ParentWebSite is an Asp.Net 4.0 Website project.

I have a Website on IIS 7.5 configured as shown below.

ParentWebSite
       ---ChildWebApp
  1. ParentWebSite is an Asp.Net 4.0 Website project.
  2. Chi开发者_如何学GoldWebApp is an Asp.Net 4.0 Web Application.

When I access the following url it works fine.

http://ParentWebSite/

When I access the childWebApplication using the following Url.

http://ParentWebSite/ChildWebApp

It gives a compilation error showing one namespace (ParentWebSite.BLL) not found. But that namespace is used only in ParentWebSite and not at all referred in the ChildWebApp.

My question why is my ChildWebApp dependent on the ParentWebSite dll?

Is not the ChildWebApp when deployed as above independent of the ParentWebSite when both are using there own App Pool?


The reason this fails is probably cause at the parentWebSite web.config there might be references to a module or handler or something of that sort that is inside that Namespace. Since configuration is inherited to child applications then your child app is trying to load the same namespace but its probably defined in an assembly inside the /bin directory of parent or /app_code/, but they are not in the children folder.

So look into the parent's web.config and see if you can find that assembly being referenced there.

If I'm right, you can set the inheritInChildApplications="false" to prevent this inheritance behavior.


Is the child application configured as an application (right-click, Convert to Application)?

0

精彩评论

暂无评论...
验证码 换一张
取 消