2010-06-15 96 views
0

我想添加運行在.Net 4應用程序池上的Silverlight應用程序,作爲運行在Classic .Net應用程序池上的ASP.Net應用程序的子應用程序。由於Silverlight應用程序繼承了父應用程序的配置元素,我收到了一些配置錯誤。有沒有人知道一篇文章或一些基本步驟,可以幫助澄清完成此任務的過程?主機.net 4網站作爲孩子的.net 3.5網站

謝謝

回答

0

兩個應用程序(.NET 3.5和.NET 4),就需要在不同的應用程序池中運行。

I.e.包含.NET 4應用程序的子文件夾將需要是自己的應用程序,並分配給不同的應用程序池。

但是也不會是一個Silverlight應用程序---他們將服務器配置文件.NET(Silverlight的沒有意義,它是客戶端應用程序,而不是一個網站)。

+0

他們是在不同的應用程序池中。我收到錯誤「有重複的‘System.Web.Extensions程序/腳本/ scriptResourceHandler’部分定義的」 我想這是一些發出來與孩子申請繼承了父配置元素。有任何想法嗎? – Sidney 2010-06-15 16:22:11

+0

@Sidney:正如我所知,IIS應用程序根目錄下的web.config只能從機器配置文件(machine.config + web.config在同一文件夾中)繼承。但是這是在我的名單上來檢查這一點。 – Richard 2010-06-15 19:44:24

2

將system.web.extensions sectionGroup從父3.5 web.config移動到位於機器上的根2.0 web.config。您可能不必移動所有部分,只需「system.web.extensions」即可。 2.0根web.config位於此處:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ CONFIG或在這裏:C:\ Windows \ Microsoft.NET \ Framework64 \ v2.0.50727 \ CONFIG。

<configSections> 
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
     <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
     <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> 
     <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> 
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> 
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> 
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> 
     </sectionGroup> 
     </sectionGroup> 
    </sectionGroup>  
</configSections> 

看起來很奇怪必須更改根web.config,但它確實有效。

您還需要包裝部分父web.config中與位置標籤,像這樣:

<location path="" inheritInChildApplications="false" > 
    <appSettings /> 
    <connectionStrings /> 
    <system.web> 
    <!-- Removed for brevity --> 
    </system.web> 
    <system.codedom> 
    <!-- Removed for brevity --> 
    </system.codedom> 
    <system.webServer> 
    <!-- Removed for brevity --> 
    </system.webServer> 
</location> 

在這裏看到:

ASP.NET 4 Child Applications Fail to Start When Under ASP.NET 2.0 or ASP.NET 3.5 Applications