托管.Net 4网站作为.Net 3.5网站的孩子

时间:2010-06-15 15:42:23

标签: .net asp.net .net-3.5 iis-7 silverlight-4.0

我正在尝试将在.Net 4应用程序池上运行的Silverlight应用程序添加为在Classic .Net应用程序池上运行的ASP.Net应用程序的子应用程序。由于Silverlight应用程序从父应用程序继承配置元素,我收到了几个配置错误。有没有人知道一篇文章或一些基本步骤,可以帮助澄清完成这项任务的过程?

谢谢

2 个答案:

答案 0 :(得分:2)

将system.web.extensions sectionGroup从父3.5 web.config移动到位于计算机上的root 2.0 web.config。您可能不必移动所有部分,只需“system.web.extensions”。 2.0 root 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

答案 1 :(得分:0)

这两个应用程序(.NET 3.5和.NET 4)需要在不同的应用程序池中运行。

即。包含.NET 4应用程序的子文件夹需要是自己的应用程序,分配给不同的应用程序池。

然而,两者都不是Silverlight应用程序---它们将是服务器配置文件.NET(Silverlight没有意义,它适用于客户端应用程序,而不是网站)。