如何在IIS6上运行.NET 4.5网站?

24

我有一台运行着IIS 6的旧Windows 2003服务器,我选择了.NET 4.5作为我的最新Web应用程序。问题是我无法在服务器上运行它...

.NET 4.0框架已安装。我运行了aspnet_regiis并部署了网站。我为它分配了自己的应用程序池。但我收到以下错误:

The 'targetFramework' attribute in the <compilation> element of the Web.config 
file is used only to target version 4.0 and later of the .NET Framework (for 
example, '<compilation targetFramework="4.0">'). The 'targetFramework' attribute
currently references a version that is later than the installed version of the 
.NET Framework. Specify a valid target version of the .NET Framework, or install 
the required version of the .NET Framework.

我看到.NET 4.5的要求需要Windows Server 2008或更高版本,但我看到很多帖子中人们只需要配置MVC4的路由,所以这似乎是可能的。

那么,我需要做什么才能让它工作呢?

编辑:奇怪的是我们正在使用一个ASP.NET Web API网站,它可以正常工作...但这应该需要.net 4.5...


1
MVC 4 / Web API 只需要 .NET 4,而不是 .NET 4.5。因此,如果您的应用程序针对 .NET 4,则可以在必要时运行到 XP SP3 / Server 2003。 - Levi
1个回答

39

.Net 4.5无法安装在Windows Server 2003上。

相反,你应该使用在.Net 4.0下工作正常的MVC 4.0。


1
你可以降级 .Net 或升级 Windows。除非你正在使用大量新的 Task 方法,否则降级 .Net 不应该太难。 - SLaks
升级完成了...很高兴运维人员如此愿意合作!可惜没有解决方法...我真的可以看到在某些环境中这可能会成为一个问题。 - CodeRedick
1
@Telos,有一个主要问题,.net 4.0 Web Forms无法正确检测IE11(某些JavaScript不会被渲染),目前唯一的解决方案是安装.net 4.5... - Peter
@SLaks 感谢您的回答。但是,我只想知道我能否在XP / Server 2003(x86-x64)上安装.NET Framework 4.5? - VVB
@VVB 你不会是认真的吧?只需要读他回答的第一行:“.Net 4.5无法安装在Windows Server 2003上。” - Andrew Fox
显示剩余8条评论

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接