简体   繁体   English

在.NET 2.0应用程序池中运行ASP.NET 4应用程序

[英]Running a ASP.NET 4 app in .NET 2.0 app pool

I recently upgraded a .NET 2.0 app to .NET 4 and everything works great. 我最近将.NET 2.0应用程序升级到.NET 4,并且一切正常。

When I setup IIS I selected .NET 2.0 under the ASP.NET tab in IIS 6. 设置IIS时,我在IIS 6的ASP.NET选项卡下选择了.NET 2.0。

The app runs fine but I get these intermittent ViewState errors. 该应用程序运行正常,但出现了间歇性的ViewState错误。

Could the IIS setup be causing the ViewState issues? IIS安装程序可能导致ViewState问题吗?

Probably because view state in .Net 4 uses a different algorithm than earlier 可能是因为.Net 4中的视图状态使用的算法与以前的算法不同

ASP.NET uses both encryption and hashing algorithms to help secure data such as forms authentication cookies and view state. ASP.NET使用加密和哈希算法来帮助保护数据,例如表单身份验证cookie和视图状态。 By default, ASP.NET 4 now uses the HMACSHA256 algorithm for hash operations on cookies and view state. 默认情况下,ASP.NET 4现在使用HMACSHA256算法对Cookie和视图状态进行哈希操作。 Earlier versions of ASP.NET used the older HMACSHA1 algorithm. 早期版本的ASP.NET使用较旧的HMACSHA1算法。

ASP.NET 4 Breaking Changes ASP.NET 4重大更改


You need to register .Net Framework 4.0 in IIS, then run your site under Application pool for .Net 4.0 您需要在IIS中注册.Net Framework 4.0,然后在.Net 4.0的“应用程序池”下运行您的站点

您需要注册4.0框架,此链接将为您提供帮助: http : //msdn.microsoft.com/zh-cn/library/k6h9cz8h.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM