VS Extension & HttpClient : FileNotFoundException

Recently I was working on a Visual Studio Extension which required HttpClient when I ran into the following exception. Frustratingly enough, I wasn't able to resolve it myself, despite playing around with the versions and using Binding Redirect. System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Net.Http,Version=4.2.0.0, Culture=neutral, ..... The system cannot find the file specified. … Continue reading VS Extension & HttpClient : FileNotFoundException

Linq Recipes : IsIncreasing/IsDecreasing & IsAlternating

LINQ, ever since its introduction has turned out to be one of the favorite tools for .Net Developers. The post focus on couple of quick recipes for common scenarios. Scenario 001 You have a collection of objects and you would like verify if the collection is sorted in increasing/decreasing order. Recipe We could always sort … Continue reading Linq Recipes : IsIncreasing/IsDecreasing & IsAlternating

Enumerable.Empty Vs Array Initialization Syntax

The following set of code showcases two most commonly used methods to generate an empty array in C#. What would be the output of the above lines of code ? One might be tempted to say both returns True. However, that isn't quite right. The output is as follows. The Enumerable.Empty returns the same empty … Continue reading Enumerable.Empty Vs Array Initialization Syntax

Async : IProgress and Immutability

In the previous post, we explored IProgress interface briefly and understood how it helps us in reporting progress. It seemed a perfect fit choice, with little chances of human errors. However, there are things one needs to be aware of to ensure you do not end up with unrecognizable errors. Let's rewrite the code in … Continue reading Async : IProgress and Immutability

Reporting Progress in Async Method

Quite often you would need to provide some kind of progress from your long running asynchronous method, especially if it process multiple activities. Though there might be multiple ways to achieve it, Microsoft provides us with a simple and efficient interface IProgress, which enables us to achieve the result. Let's hit the code straightaway. The … Continue reading Reporting Progress in Async Method

Evil Code #007: Overloads

Time to do a bit of Evil Code again. Let's look into following set of classes first. The client code looks like following. What could be output of the above ? There might be tendency that the one might be inclined to think about an output that resembles following. But interestingly that is not quite … Continue reading Evil Code #007: Overloads