简体   繁体   English

Asp.net 4.0子应用程序在IIS 7.5上不起作用?

[英]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. 我在IIS 7.5上有一个网站,如下所示。

ParentWebSite
       ---ChildWebApp
  1. ParentWebSite is an Asp.Net 4.0 Website project. ParentWebSite是一个Asp.Net 4.0网站项目。
  2. ChildWebApp is an Asp.Net 4.0 Web Application. ChildWebApp是一个Asp.Net 4.0 Web应用程序。

When I access the following url it works fine. 当我访问以下网址时,它工作正常。

http://ParentWebSite/

When I access the childWebApplication using the following Url. 当我使用以下Url访问childWebApplication时。

http://ParentWebSite/ChildWebApp

It gives a compilation error showing one namespace (ParentWebSite.BLL) not found. 它给出了一个编译错误,显示找不到一个命名空间(ParentWebSite.BLL)。 But that namespace is used only in ParentWebSite and not at all referred in the ChildWebApp. 但是该命名空间仅在ParentWebSite中使用,而在ChildWebApp中根本没有引用。

My question why is my ChildWebApp dependent on the ParentWebSite dll? 我的问题为什么我的ChildWebApp依赖于ParentWebSite dll?

Is not the ChildWebApp when deployed as above independent of the ParentWebSite when both are using there own App Pool? 当两个人都使用自己的应用程序池时,不是像以上那样独立于ParentWebSite部署的ChildWebApp?

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. 这种失败的原因可能是因为在parentWebSite web.config中可能会引用模块或处理程序或该类型空间内的那种类型。 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. 由于配置继承到子应用程序,因此您的子应用程序正在尝试加载相同的命名空间,但它可能在父或/ app_code /的/ bin目录中的程序集中定义,但它们不在子文件夹中。

So look into the parent's web.config and see if you can find that assembly being referenced there. 因此,请查看父级的web.config,看看是否可以找到那里引用的程序集。

If I'm right, you can set the inheritInChildApplications="false" to prevent this inheritance behavior. 如果我是对的,您可以设置inheritInChildApplications =“false”以防止此继承行为。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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