3

I'm having an issue with following build error in VS2017

  Error CS0433: The type 'HttpClient' exists in both 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Net.Http, Version=4.1.1.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' (20, 26)

I have been trying the following:

  • Update all existing references to 4.1.1.2
  • Install 4.1.1.2 to all projects in solution
  • Added binding redirects to all projects

I'm for sure missing something, but what? Any way to find what is locking it to 4.0.0.0?

Erik Karlsson
  • 570
  • 1
  • 6
  • 17
  • RestSharp installation? You have a binding conflict in a dependent Assembly configuration. See this: [System.Net.Http dll version problems](https://gertjanvanmontfoort.blogspot.com/2017/11/systemnethttp-dll-version-problems.html) and this: [Could not load file or assembly 'System.Net.Http'](https://stackoverflow.com/questions/47149345/could-not-load-file-or-assembly-system-net-http). Some manual editing required. – Jimi Jul 22 '18 at 22:28
  • @Jimi RestSharp came to my mind, but i would like to solve the root case if possible Build folder outputs System.Net.Http with version 4.6.25705.1 so should be fine – Erik Karlsson Jul 23 '18 at 09:46
  • @mjwills Consolidate didn't help, been going through packages and also updating ones safe to update etc but error still there – Erik Karlsson Jul 23 '18 at 09:47
  • If you load the Package Manager, is anything shown in the `Consolidate` tab? – mjwills Jul 23 '18 at 09:49
  • @mjwills No, nothing is shown – Erik Karlsson Jul 23 '18 at 10:36
  • Refactoring and removing some dependencies solved the issue But now i have code referencing System.Net.Http, but without a reference to it, and it is still working Probably from other, indirect references? – Erik Karlsson Jul 23 '18 at 21:57

0 Answers0