简体   繁体   中英

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

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. ChildWebApp 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.

子应用程序是否配置为应用程序(右键单击, Convert to Application )?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM