System.Net.Http Version 4.0.0.0 Could Not Load – Solution

Are you ever getting the error “System.Net.Http Version 4.0.0.0 Could Not Load” in your .NET application? This common issue mostly appears after upgrading your project, installing NuGet packages, or deploying to a new server. The good news is that it’s not a tough problem; a version mismatch, missing assembly, or incorrect binding redirect reason for this error. In this article, you’ll learn what the steps are to fix the error quickly and stop it from happening again.

System.IO.FileNotFoundException: ‘Could not load file or assembly ‘System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies.’

Why This “System.Net.Http Version 4.0.0.0 Could Not Load” Happens

This error occurs when your application tries to load System.Net.Http version 4.0.0.0, but either:

  1. The assembly is missing from your project or output folder.
  2. There’s a version mismatch between your project’s references and the runtime environment.
  3. Your project targets .NET Framework 4.7+ while referencing an older version of System.Net.Http from NuGet.

In short, your app is looking for a version of the library that it can’t find.

Step 1: Check Your Project References

  1. Open your project in Visual Studio.
  2. Go to Solution Explorer → References.
  3. Look for System.Net.Http.
  4. Right-click → Properties, and check the Version.

Make sure it matches the version your application expects. For .NET Framework 4.7.2 or higher, you typically do not need a NuGet package, because the assembly is part of the framework.

Step 2: Remove Conflicting NuGet Packages

Sometimes the issue occurs because an older NuGet package overrides the framework version. To fix:

  1. Open Package Manager Console or NuGet Package Manager.
  2. Check for System.Net.Http packages:
Get-Package | Where-Object {$_.Id -eq "System.Net.Http"}
  1. Uninstall any older versions:
Uninstall-Package System.Net.Http
  1. Clean and rebuild your project.

Step 3: Add a Binding Redirect

If your project references multiple assemblies that depend on different versions of System.Net.Http, a binding redirect ensures all of them use a single version.

  1. Open App.config (or Web.config for web apps).
  2. Add or update the <dependentAssembly> section under <runtime>:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Adjust newVersion according to the version installed in your project.

Step 4: Clean, Rebuild, and Restart

After making changes:

  1. Clean SolutionBuild → Clean Solution
  2. Rebuild SolutionBuild → Rebuild Solution
  3. Close Visual Studio → Reopen → Run the project

This ensures that Visual Studio picks up the correct assembly references.

Step 5: Verify Target Framework

Make sure your project targets a compatible framework version:

  1. Right-click your project → Properties → Application → Target framework
  2. Choose .NET Framework 4.7.2 or higher
  3. Rebuild the project

Targeting newer frameworks reduces conflicts with System.Net.Http and avoids unnecessary NuGet references.

System.Net.Http Version 4.0.0.0 Could Not Load Solution

Leave a Reply

Your email address will not be published. Required fields are marked *