在 VS 中 调试打开网页没问题,
我把项目文件拷贝到 IIS 目录下,并且在IIS 中创建好目录,
但是当我在本地和远程打开之前相同网页时,总是报 web.config 错误。
咋回事呢?
Server Error in '/' Application.
--------------------------------------------------------------------------------Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.Source Error: 
Line 27:    </controls>
Line 28:   </pages>
Line 29:      <compilation debug="true"  targetFramework="4.0">
Line 30:  <assemblies>
Line 31:  <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
 Source File: C:\Inetpub\wwwroot\test\web.config    Line: 29 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 

解决方案 »

  1.   

    在哪看我的 IIS 版本多少来着的?确认版本后, 是不是只要把 targetFramework 参数值改下就行了?
      

  2.   

    IIS 站点属性--asp.net选项卡选择版本
      

  3.   

    asp.net 选项卡版本 选择只有  2.0 和 4.0 选择。IIS 版本是 6.0 的。
      

  4.   

    不对啊, 我查了帮助,
    targetFramework 指定网站的目标 .Net Framework 版本啊。我的 .net framework 版本是 4.0 啊, 么有错啊。
      

  5.   

    打开IIS 右击你创建的站点 选属性 -> 最后一个选项卡ASP.NET -> 确认你的ASP.NET版本是不是4.0的。
      

  6.   

    to 8 楼有2.0 和 4.0 版本可选。另外在网上搜了半天, 发现说是要改下 application pool 版本,选择 4.0 的。
    但没找着应用程序池可以改版本的地方。
    请指导