【问题标题】:Runtime problems for ASP.Net website in IIS7/Win7 .Net 4.0IIS7/Win7 .Net 4.0 中 ASP.Net 网站的运行时问题
【发布时间】:2011-03-25 00:11:19
【问题描述】:

在 VS2010 中,项目的目标框架是 4.0。 在 IIS7 中,localhost 的 .Net 版本是 4.0。 但是对于我的应用程序的应用程序池,没有 4.0 框架可供选择。 在我部署站点并从中浏览文件后,我收到此错误:

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error:

Line 14: 
Line 15:   <system.web>
Line 16:     <compilation debug="true" targetFramework="4.0" />
Line 17: 
Line 18:     <authentication mode="Forms">


Source File: C:\inetpub\wwwroot\TestApp\web.config    Line: 16

Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 

请帮帮我。

谢谢 雷迪

【问题讨论】:

    标签: c# asp.net deployment .net-framework-version


    【解决方案1】:

    如果 .Net 4.0 可用,请转到服务器 IIS 管理器并选择“应用程序池”并将 .Net 框架设置为您网站的 4.0。

    【讨论】:

      【解决方案2】:

      您应该在您的服务器上安装 .net 4 运行时。 如果你已经运行了 aspnet_regiis.exe

      【讨论】:

      • 我正在开发机器本身上部署应用程序。它在调试时工作正常。这不是说我安装了 .Net FW 4.0 运行时吗?
      • 在调试过程中,您可能正在使用不是 IIS 的 VS 内置网络服务器。运行 aspnet_regiis.exe
      【解决方案3】:

      您需要在服务器上安装 .Net 4.0。安装后,您就可以将应用程序池设置为使用 .Net 4.0 框架。

      错误消息显示它正在尝试使用无法处理您的 web.config 文件的 .Net 2.0 运行您的应用程序。

      【讨论】:

        猜你喜欢
        • 2011-11-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-01-30
        相关资源
        最近更新 更多