Couple of times I have encountered the interaction between Task and IDisposable and sometimes it has left me with some serious code bug.
Let’s come to sample code which will explain the crux of the issue. Suppose you have below line of code
Now HttpClient does provides the async version of "GetString" which is "GetStringAsync", so we can write the above line of code as shown below:
Now the above code might look perfect and it may work fine sometime. But it has a serious code bug. In the second version, here's what happens:
Now below is the revised version which will run effectively
Now, if you see we have included the "async" and also the corresponding "await" keyword. And it runs effectively like this:
Recently Microsoft announced the new .Net Framework 4.7.1 Early access build with the Developer pack. The .NET Framework 4.7.1 Developer Pack lets developers build applications that target the .NET Framework 4.7.1 by using Visual Studio 2017, Visual Studio 2015 or other IDEs. This is a single package that bundles the .NET Framework 4.7.1, the .NET 4.7.1 Targeting Pack, and the .NET Framework 4.7.1 SDK.
This pre-release includes improvements in several areas and below are some of the new features which are available in this release.
To install the latest .Net framework: