Could not load file or assembly Microsoft.Win32.Primitives, Version=4.0.0.0

Cody picture Cody · Feb 18, 2017 · Viewed 12.6k times · Source

I am having problems running my web application.

The project setup is ASP.NET Core web application (.NET Framework). I don't seem to get any Build error. The project doesn't just run.

System.IO.FileLoadException: 'Could not load file or assembly 'Microsoft.Win32.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

enter image description here

Answer

Tom Robinson picture Tom Robinson · Apr 25, 2017

Try adding the System.Net.Http nuget package.