2010-06-15 95 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