Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert projects to .Net 4.5 ( that uses TPL)

Currently own a few projects with .net 3.5 and .net 4.0.
It was decided to migrate all to .NET 4.5.

All projects are already in VS2012 (C# 5.0) and all projects using async-await keywords

On .net 4.0 projects is being used Microsoft.Bcl.Async
On .net 3.5 projects is being used AsyncBridge.Net35 and TaskParallelLibrary

The problem is:
- There is no TaskEx class and other extension methods in .net 4.5 or I do not know the existence of these

How can I make this change, without major changes in the code?

like image 653
J. Lennon Avatar asked Dec 05 '25 10:12

J. Lennon


1 Answers

In .NET 4.5, the TaskEx methods have been moved into the Task class. For example, instead of await TaskEx.Run(...);, you use await Task.Run(...);. You should, assuming your naming scheme of your own classes is sane, be able to do a global search-and-replace.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!