2011-09-06 2 views
0

Я прочитал много статей и вопросов в сети об этой проблеме, но я не нашел правильного решения для своей проблемы.asp.net 4.0 web.config inheritance

У меня есть веб-приложение (родительское), которое включает в себя еще несколько веб-приложений.

У дочерних приложений есть свой файл web.config и устанавливается в приложение в IIS (7.5).

В корневом приложении я установить <location> тег:

<location path="." inheritInChildApplications="false"> 
<system.web> 
    <compilation debug="true" targetFramework="4.0"> 
    </compilation> 
    <authentication mode="Forms"/> 
    <customErrors mode="Off" /> 
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> 
     <controls> 
      <add tagPrefix="web" namespace="CustomControls" assembly="YouSites"/> 
      <add tagPrefix="web" namespace="YouSites.Code" assembly="YouSites"/> 
      <add tagPrefix="web" tagName="ScriptLoader" src="~/UserControls/ScriptLoader.ascx"/> 
      <add tagPrefix="web" tagName="ParameterControl" src="~/UserControls/ParameterControl.ascx"/> 
     </controls> 
    </pages> 

</system.web> 
</location> 

в приложении ребенка, я установил следующие строки:

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> 
     <controls> 
      <add tagPrefix="web" tagName="Content" src="~/UserControls/Content.ascx"/> 
      <add tagPrefix="web" tagName="DynamicBox" src="~/UserControls/DynamicBox.ascx"/> 
      <add tagPrefix="web" tagName="GlobalStyle" src="~/UserControls/GlobalStyle.ascx"/> 
      <add tagPrefix="web" tagName="Image" src="~/UserControls/Image.ascx"/> 
      <add tagPrefix="web" tagName="String" src="~/UserControls/String.ascx"/> 
      <add tagPrefix="web" namespace="ApiShared.CustomControls.Frame" assembly="ApiShared"/> 
     </controls> 
    </pages> 

Теперь, когда приложение запускается ребенок, я получаю следующая ошибка:

Server Error in '/Layouts/vital' Application. 
-------------------------------------------------------------------------------- 

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Unknown server tag 'web:GlobalStyle'. 

Source Error: 


Line 7:  <script type="text/javascript" src="Assets/jquery-1.4.3.js"></script> 
Line 8:  <script type="text/javascript" src="Assets/jquery.simplemodal-1.4.1.js"></script> 
Line 9:  <web:GlobalStyle runat="server" /> 
Line 10:  <title></title> 
Line 11: </head> 

Моя идея в том, что ребенок web.config по-прежнему я nheriting from the main, пути просто прекрасны, но я не думаю, что он даже читается из файла child.config для ребенка.

Спасибо заранее,

Gal

ответ

0

ли ребенок определенно установить в качестве приложения в IIS? Существует ли контрольная dll в каталоге bin для дочерних элементов? Был ли установлен элемент управления GlobalStyle дочернему приложению. Работает ли он, когда он не вложен?

В основном жалуется, потому что тип не может быть разрешен.