将.Net Framework 2.0升级到4.5

时间:2022-11-03 03:17:37

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?

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

1 个解决方案

#1


14  

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".

如果你已经升级到3.5,那么你就可以了,因为3.5只是建立在2.0之上。 NET 4.5不是2.0的完美超集。有一些差异,没有看到你的所有代码没有人,甚至Jon Skeet都不能告诉你转换是否“正常”。

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.

我建议学习这篇MSDN文章,试着找出升级中可能受到影响的内容,如果有的话,然后重点关注你的测试。这种方法实际上可能比逐页测试更有效,这种测试不可避免地会遗漏某些内容。从2.0到4.5的更改可能根本不会影响您的代码库。以下是从3.5到4.0的详尽更改列表。特别注意ASP.NET部分,有很多。

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

从最后一个链接开始,实际上有一个样本(可能更多)可能会让您单独检查每个页面:

Page parsing

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.

ASP.NET Web页面(.aspx文件)和用户控件(.ascx文件)的页面解析器在ASP.NET 4中比在早期版本的ASP.NET中更严格,并且它标记的标记比早期版本更多。

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.

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

#1


14  

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".

如果你已经升级到3.5,那么你就可以了,因为3.5只是建立在2.0之上。 NET 4.5不是2.0的完美超集。有一些差异,没有看到你的所有代码没有人,甚至Jon Skeet都不能告诉你转换是否“正常”。

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.

我建议学习这篇MSDN文章,试着找出升级中可能受到影响的内容,如果有的话,然后重点关注你的测试。这种方法实际上可能比逐页测试更有效,这种测试不可避免地会遗漏某些内容。从2.0到4.5的更改可能根本不会影响您的代码库。以下是从3.5到4.0的详尽更改列表。特别注意ASP.NET部分,有很多。

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

从最后一个链接开始,实际上有一个样本(可能更多)可能会让您单独检查每个页面:

Page parsing

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.

ASP.NET Web页面(.aspx文件)和用户控件(.ascx文件)的页面解析器在ASP.NET 4中比在早期版本的ASP.NET中更严格,并且它标记的标记比早期版本更多。

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.

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