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.

The Binding Redirect didn’t quite as it is not possible to use the redirects in VS Extensions. However, the solution turned out to be choosing an alternative for HttpClient as pointed in SOF.

Instead of HttpClient, I had to depend on something which is more native to.Net, like HttpWebRequest. Hope this post is useful to anyone who stumbles on similar issues.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s