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.
  2. ParentWebSite是一個Asp。Net 4.0的網站項目。
  3. ChildWebApp is an Asp.Net 4.0 Web Application.
  4. ChildWebApp是一個Asp。Net 4.0 Web應用程序。

When I access the following url it works fine.

當我訪問下面的url時,它工作得很好。

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. But that namespace is used only in ParentWebSite and not at all referred in the ChildWebApp.

它給出一個編譯錯誤,顯示沒有找到名稱空間(ParentWebSite.BLL)。但是這個名稱空間只在ParentWebSite中使用,而在ChildWebApp中根本沒有提到。

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

我的問題是為什么我的ChildWebApp依賴於父母網站dll?

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

如上所述,當雙方都在使用自己的應用程序池時,ChildWebApp不是獨立於ParentWebSite嗎?

2 个解决方案

#1


2  

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.

這一失敗的原因可能是父母網站的原因。配置,可能有對模塊或處理器的引用,或者類似於命名空間中的東西。由於配置是繼承給子應用程序的,所以您的子應用程序正在嘗試加載相同的名稱空間,但是它可能在父或/app_code/的/bin目錄內的程序集中定義,但是它們不在子文件夾中。

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.

如果我是正確的,您可以設置繼承子應用程序=“false”,以防止這種繼承行為。

#2


0  

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

是否將子應用程序配置為應用程序(右鍵單擊,將其轉換為應用程序)?


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2010/06/21/72fffc506893e7423e33077cfcc1d331.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com