简体   繁体   English

如果将.NET 4.0升级到4.6,会发生什么情况

[英]what happen If upgrade .NET 4.0 to 4.6

I've made a project 2 years a go , It used .NET 4.0 and know I Want to Upgrade .NET FrameWork to 4.6 , I haven't any experience about this and I want to know does it take too long ? 我已经进行了2年的项目,它使用.NET 4.0并且知道我想将.NET FrameWork to 4.6升级.NET FrameWork to 4.6 ,我对此没有任何经验,我想知道它是否花了太长时间? what problems will be happen ? 会发生什么问题?

thanks 谢谢

The short answer is 'very little'. 简短的回答是“很少”。 In general, the later versions add to the existing .Net structure and change as little as possible. 通常,更高版本会添加到现有的.Net结构中,并尽可能少地进行更改。 Therefore you should be able to change the target framework and click rebuild and you are good to go. 因此,您应该能够更改目标框架并单击“重建”,然后就可以开始使用了。

There are a few caveats: 有一些警告:

  1. You must remember to ensure that the installation has access to the .Net framework version that you wish to use. 您必须记住确保安装可以访问您要使用的.Net框架版本。 For some computers that may mean setting it as a pre-requisite and / or including the version in your installers. 对于某些计算机,这可能意味着将其设置为必备软件和/或在安装程序中包括该版本。
  2. Although rare, there may be some things that may change in a breaking manner. 尽管很少见,但有些事情可能会以破坏性的方式改变。 If that is the case you will normally be guided by the compiler on any changes that are needed when you rebuild. 在这种情况下,编译器通常会指导您进行重建时需要进行的任何更改。
  3. There may well be better ways of doing things since you wrote the original code. 自编写原始代码以来,可能会有更好的处理方式。 You need to decide before you start whether you are going to look to upgrade your code at the same time. 您需要在开始之前决定是否要同时升级代码。

Finally, if you change the target version and it looks like being too much work when you rebuild then you can always change it back again... 最后,如果您更改了目标版本,并且在重建时看起来工作量太大,那么您可以随时再次将其更改回...

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

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