迁移ASP.NET(MVC 2)在.NET 3.5以上到.NET 4 #gotchas [英] Migrating ASP.NET (MVC 2) on .NET 3.5 over to .NET 4 #gotchas
问题描述
我目前得到的.NET 3.5中的ASP.NET MVC 2应用程序,我想在迁移到新的.NET 4.0和Visual Studio 2010。
I've currently got a ASP.NET MVC 2 application on .NET 3.5 and I want to migrate it over to the new .NET 4.0 with Visual Studio 2010.
原因是,它总是好的留下来的这些东西上面 - 再加上我真的很喜欢新的自动编码与<%:%>
和<一href="http://weblogs.asp.net/scottgu/archive/2009/08/25/clean-web-config-files-vs-2010-and-net-4-0-series.aspx"相对=nofollow>干净的web.config : - )
Reason being that it's always good to stay on top of these things - plus I really like the new automatic encoding with <%: %>
and clean web.config :-)
所以,没有任何人有任何的经验,他们可以分享?寻找陷阱和喜欢。
So, does anyone have any experience they could share? Looking for gotchas and the likes.
我想这可能也适用于ASP.NET窗体项目以及。
I guess this could also apply to any ASP.NET Forms projects aswell.
TIA,
查尔斯
TIA,
Charles
推荐答案
疑难杂症#1 - 更改应用程序池
Gotcha #1 - Changes application pool
如果您的ASP.NET项目设置为使用IIS,而不是卡西尼,在升级过程中的.NET 4.0的过程,它会自动更改您的网站使用新的ASP.NET 4.0版的应用程序池的应用程序池。这可能对权限的影响,如果您正在使用匿名身份验证的应用程序池标识。
If your ASP.NET project is setup to use IIS and not Cassini, during the upgrade to .NET 4.0 process it'll automatically change the application pool that your site uses to the new ASP.NET v4.0 application pool. This may have an effect on permissions if you are using the application pool identity for anonymous authentication.
疑难杂症#2 - [ValidateInput(假)]
停止工作
这是在ASP.NET 4.0中的重大更改。一个相关的问题都可以找到<一href="http://stackoverflow.com/questions/2019843/a-potentially-dangerous-request-form-value-in-mvc-2-asp-net-4-0">here.
This is a breaking change in ASP.NET 4.0. A related question can be found here.
该JIST是,你必须添加&LT;的httpRuntime requestValidationMode =2.0/&GT;
进入你的web.config
The jist is that you must add <httpRuntime requestValidationMode="2.0" />
into your web.config.
这篇关于迁移ASP.NET(MVC 2)在.NET 3.5以上到.NET 4 #gotchas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!