将.Net Framework 2.0升级到4.5 [英] Upgrade .Net Framework 2.0 To 4.5

查看:114
本文介绍了将.Net Framework 2.0升级到4.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用Visual Studio 2012将asp.net 2.0项目升级到4.5.它可以正常运行,但是我是否必须在浏览器中测试每个Web表单,还是会自动将其转换为100%?如果没有.Net Framework 2.0,转换后的项目是否可以正常工作?

I have upgraded my asp.net 2.0 project to 4.5 by using Visual Studio 2012. It is building fine, but will I have to test each webform in the browser or will it be converted 100% automatically? Without the .Net Framework 2.0, will the converted project work fine?

推荐答案

如果您已升级到3.5,则可以,因为3.5只是建立在2.0之上.NET 4.5不是2.0的完美超集.有一些区别,并且没有看到您所有的代码,甚至没有人能甚至告诉您 Jon Skeet 如果转换将正常".

If you had upgraded to 3.5 you would be fine since 3.5 simply built on top of 2.0. NET 4.5 is not a perfect superset of 2.0. There are some differences and without seeing ALL of your code no one, not even Jon Skeet, could tell you if the conversion will "work fine".

我建议您研究此MSDN文章尝试找出答案升级可能受到的影响(如果有的话),然后重点进行测试.这种方法实际上可能比逐页测试会更有效,因为逐页测试不可避免地会遗漏某些内容.从2.0到4.5的更改也可能根本不影响您的代码库.这是从3.5到4.0的详尽更改列表.要特别注意ASP.NET的部分,很多.

I would suggest studying this MSDN article to try and figure out what might have been affected in your upgrade, if anything, and then focusing your testing. Such an approach might actually be more effective than a page-by-page test which would inevitably miss something. It is also possible that the changes from 2.0 to 4.5 might not affect your code-base at all. Here is an exhaustive list of changes from 3.5 to 4.0. Pay special attention to the ASP.NET parts, there are many.

在最后一个链接中,实际上有一个示例(可能更多),可能需要您分别检查每个页面:

From that last link there is actually a sample (probably more) that might have you checking each page individually:

页面解析

ASP.NET网页(.aspx文件)和用户控件的页面解析器(.ascx文件)在ASP.NET 4中比在早期版本中更严格ASP.NET,与早期版本相比,它标记的标记更多为无效标记.

The page parser for ASP.NET Web pages (.aspx files) and user controls (.ascx files) is stricter in ASP.NET 4 than in earlier versions of ASP.NET, and it flags more markup as invalid than in earlier versions.

检查页面运行时产生的错误消息并修复无效标记导致的错误.

Examine error messages that are produced when a page runs and fix errors that result from invalid markup.

由于存在标记差异,因此您应该检查每个页面并控制正确的呈现.

Since there are markup differences, you should really check each page and control for proper rendering.

这篇关于将.Net Framework 2.0升级到4.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆