Asp.net 为什么我要在我的webconfig中注释以下行才能在IIS中工作?

Asp.net 为什么我要在我的webconfig中注释以下行才能在IIS中工作?,asp.net,web,iis-7.5,Asp.net,Web,Iis 7.5,我不熟悉IIS 7.5(窗口7) 如果我将新的ASP.NET 3.5网站的目标放在本地IIS上,它就可以正常工作。 但是,如果我新建了一个文件系统ASP.NET3.5网站,并从IIS添加了该网站并对其进行了配置,那么它将无法工作。我明白了 为了工作,我不得不评论以下几行 <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, Syst

我不熟悉IIS 7.5(窗口7)

如果我将新的ASP.NET 3.5网站的目标放在本地IIS上,它就可以正常工作。 但是,如果我新建了一个文件系统ASP.NET3.5网站,并从IIS添加了该网站并对其进行了配置,那么它将无法工作。我明白了

为了工作,我不得不评论以下几行

<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>

我想知道为什么我要注释这些行,而第一种方法不需要这样做

多谢各位

编辑:


当我说第一种方式时,我的意思是在创建webiste时,我在Weblocation下拉列表中选择了“Http”而不是“文件系统”。并将其定位在Visual Studio提供的IIS而不是Web服务器上。正如错误所述,这是因为它们是重复的(在其他地方也定义了相同的标记)。这可能是因为它们已经在您自己的文件中的其他位置,这可能不是很可能,也可能是在machine.config中,或者在父文件夹中的另一个web.config文件中。

很可能是父配置。我也很好奇这是否安装了所有最新的.NET更新。@克劳斯:你的回答符合我在标题中提出的问题。这是一个hello word项目(只有一个aspx和webconfig文件),更可能的情况是它在machine.config中重复了。但我的问题是为什么第一个选项可以正常工作?@drachenstern:我使用VS 2010和Windows 7 64位,我应该安装其他东西吗?@Mostafa,是的。安装Mac OSX。开玩笑;-)@Mostafa~我以为你是在Windows服务器上的IIS 7.5上运行这个。。。具有所有更新的Windows 7(64)不应出现此问题。您确定已安装IIS7.5的所有组件吗?