简体   繁体   中英

Migration from .NET framework 2.0 to 4.5.2

We have an application with around 300+ components (dll's and a couple of exe's). Some of them target 4.0 framework, some use 2.0 framework, some are written in native C++ (unmanged), some uses C++/CLI and a couple of them are written in ManagedExtensions for C++.

Now our requirement is to migrate to .NET Framework 4.5.2.

So my question is:

Will it be OK if I just change the TargetFramework version on all the exe's to 4.5.2 with out changing the dll's TargetFramework version?

Does it guarantee that all my dll's are loaded and run in 4.5.2 runtime? (Included all the C++ dll's).

I have gone through multiple articles on internet and I could not find a concrete answer in the scenario where we have a mix of C#, managed c++ and unmanaged c++ dlls. Any help is appreciated.

Edit: Our team generate core libraries (sort of a framework) and few executables (targetted to 2.0 framework) which can be used by various other teams to meet their customer specific requirements. Some of the customers are not yet migrated from XP (Max .NET framework used in XP is 4.0). So along with newer OS's we still need to support clients using XP.

While 2.0 projects are generally upgradable to 4.5.x with no code changes, there are breaking-differences between .NET versions that you may run into. Given the scale and complexity of your project I must advise against blindly changing the TargetFramework property and hoping for the best.

While 4.0 executables can load 2.0 DLLs, it is not recommended because of the breaking-changes I described.

You will run into problems with the mixing of C++ code. I recommend you start by upgrading (or rather, rewriting) your "Managed Extensions for C++" code to C++/CLI (you might want to take advantage of C++11 and C++14 features present in VS2015 while you're at it).

I recommend upgrading each project individually and separately, working your way up the dependency-chain. It will help if you have (or will write) unit tests and integration tests for more critical parts of your system.

Migrating from 2.0 to 4.5.2 is just click click job, whereas no gaurantee thay it wont break anything. Recently I upgraded a webapplication to 4.5.2 and there were requestvalidation issue,3rd party tool broke and what not.

So one cannot say it will work seamlessly, you have to test it out to see if it works.

Now mixing 2.0 with 4.5.2 may cause chaos as you need to take into account consuming application too at the time of writing code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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