System.IO.FileLoadException: Could not load file or assembly ‘System.Diagnostics.DiagnosticSource, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference.

Solution:- 

  • If you use .NET Core tools preview 2 (e.g., VS2015 Update 3), then everything works fine on both .NET Framework 4.5.1 and 4.6.1.
  • If you use .NET Core tools preview 3 (e.g., VS2017RC), then it works fine on .NET Framework 4.5.1, but fails with the error you posted on .NET Framework 4.6.1.
  • The issue isn’t specific to NodeServices. You can repro the same error just by trying to use System.Net.Http.HttpClient (and NodeServices triggers it precisely because it uses HttpClient internally).

Add Comment