【问题标题】:Asp.net 4.0 child application does not work on IIS 7.5?Asp.net 4.0 子应用程序不能在 IIS 7.5 上运行?
【发布时间】:2010-06-21 19:36:40
【问题描述】:

我在 IIS 7.5 上配置了一个网站,如下所示。

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

当我访问以下网址时,它工作正常。

http://ParentWebSite/

当我使用以下 URL 访问 childWebApplication 时。

http://ParentWebSite/ChildWebApp

它给出了一个编译错误,显示未找到一个命名空间 (ParentWebSite.BLL)。但是该命名空间仅在 ParentWebSite 中使用,而在 ChildWebApp 中根本没有提及。

我的问题为什么我的 ChildWebApp 依赖于 ParentWebSite dll?

当两者都使用自己的应用程序池时,如上所述部署的 ChildWebApp 是否独立于 ParentWebSite?

【问题讨论】:

    标签: asp.net iis web asp.net-4.0 iis-7.5


    【解决方案1】:

    失败的原因可能是在 parentWebSite web.config 中可能引用了该命名空间内的模块或处理程序或类似的东西。由于配置是继承给子应用程序的,因此您的子应用程序正在尝试加载相同的命名空间,但它可能定义在父级或 /app_code/ 的 /bin 目录内的程序集中,但它们不在子级文件夹中。

    所以查看父级的 web.config,看看是否可以找到那里引用的程序集。

    如果我是对的,您可以设置inheritInChildApplications="false" 来防止这种继承行为。

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • ChildApp 被配置为 Application。
      猜你喜欢
      • 1970-01-01
      • 2012-02-14
      • 1970-01-01
      • 1970-01-01
      • 2011-09-27
      • 2010-12-28
      • 2012-12-29
      • 1970-01-01
      相关资源
      最近更新 更多