The referenced component 'System.Net.Http' could not be found

TLDR - Service Fabric services don't work well with project references to .NET Standard packages; instead, use the full .NET Framework for class libraries.


After several more hours of trial and error, I was able to determine that the issue was not with the System.Net.Http package itself, but was the result of a reference to another project within the solution.

If I referenced the project targeting netstandard1_6, the System.Net.Http references (including the dependent packages) would not load or resolve. Once I removed the project reference, they loaded fine! Ultimately, I changed my referenced project to a "regular" .NET Framework project, added a reference to that version, and all my references were fine.

There are a few things that we suspect, but aren't sure which was the ultimate cause:

  • The project file format for .NET Standard is different than .NET Framework
  • Service Fabric projects require x64, and .NET Standard projects target Any CPU

Any additional explanation would be appreciated!


Today I ran into this issue. In my case the cause was that I have Dependency Behavior in the NuGet options set to 'Lowest', which downloads the lowest compatible versions of dependent packages. Unfortunately this sometimes means it downloads a package version that is not compatible with your project's runtime version. In my case, package System.Net.Http.Formatting.Extensions caused System.Net.Http version 2.20... to be installed, which was not recognized by my .NET 4.7.1 project.

On the Updates tab in the Nuget Package manager for the solution, it will show updates for these packages. Install them and your problem should be solved. Alternatively, set the Dependency Behavior to Highest when installing NuGet packages.