Liker777 Liker777 - 1 year ago 103
C# Question

Could not load file or assembly ... The parameter is incorrect

Recently I met the following exception at C# solution:

Error 2 Could not load file or assembly 'Newtonsoft.Json,
Version=, Culture=neutral, PublicKeyToken=b9a188c8922137c6' or
one of its dependencies. The parameter is incorrect. (Exception from

This does not depend either on my code or on the name of assembly (like
in this case).

When I delete this dll from the solution the compiler tells about another in the same exception. So I suppose something shoud be turned off/on at my PC :)

Answer Source

Looks like a corrupted assembly being referenced.

Clear both:

  1. the \bin folder of your project

  2. the temp folder (should be C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET Files in windows 7)

and see if the error still happens