配置asp.net 2.0的项目到IIS7

首先碰到以下问题:

无法读取配置节"system.web.extensions",因为它缺少节声明

在微软的论坛找到了解决的办法:
http://forums.asp.net/p/1547286/3784899.aspx
 

This is because config section hasn't declared. in 4.0 webconfig you have to add it manually.

<configSections>

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

</configSections>


加好这个后碰到无法识别的属性“targetFramework”。请注意属性名称区分大小写。

这个要设置一系列IIS,关键是下面几个窗口设置:

 

然后修改.NET Framework版本。修改为4.0

 

 



 

设置需要的版本为允许允许,不然会出现如下错误:

Internet Information Services 7.5

错误摘要

HTTP 错误 404.2 - Not Found

由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面。

设置方法:
(1)、打开ISAPI和CGI限制

(2)、找到你需要但被设为不允许运行的版本,

 

(3)、把需要运行的版本设置为“允许”,即可

 

 



展开阅读全文

没有更多推荐了,返回首页