在VS2010中,项目的目标框架是4.0。 在IIS7中,localhost的.Net版本是4.0。 但对于我的应用程序的App Pool,没有可供选择的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
请帮帮我。
由于 雷迪
答案 0 :(得分:0)
您需要在服务器上安装.Net 4.0。安装完成后,您就可以将应用程序池设置为使用.Net 4.0框架。
错误消息显示它正在尝试使用.Net 2.0运行您的应用程序,但无法处理您的web.config文件。
答案 1 :(得分:0)
您应该在服务器上安装.net 4运行时。 如果你已经运行了aspnet_regiis.exe
答案 2 :(得分:0)
如果.Net 4.0可用,请转到服务器IIS管理器并选择“应用程序池”,并将.Net框架设为4.0为您的网站。