Search code examples
asp.net.netasp.net-mvcvisual-studio-2017

Could not load file or assembly 'System.Runtime.Serialization.Primitives' or one of its dependencies


I am getting this YSOD when I run my MVC app, it was all working fine until I took a latest Visual Studio 2017 update.

enter image description here

What could possibly be causing this issue?

I have also tried adding System.Runtime.Serialization.Primitives, nope that doesn't work.

I am using Newtonsoft.Json version 11.0.0.0

In my Solution explorer the System.Runtime.Primitives shows broken

enter image description here

Target Framework 4.7.1


Solution

  • Open PM Console in Visual Studio and run this command:

    Install-Package System.Runtime.Serialization.Primitives