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=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

This does not depend either on my code or on the name of assembly (like Newtonsoft.Json 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 :)


Looks like a corrupted assembly being referenced.

Clear both:

  • the bin folder of your project

  • the temp folder (should be C:Usersyour_usernameAppDataLocalTempTemporary ASP.NET Files in windows 7)

  • and see if the error still happens


    Depending on if your are running X64 you might need to clean up a couple more spots. Just cleaning up my user directory was not enough.

  • %TEMP%Temporary ASP.NET Files
  • C:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files
  • C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files
  • C:WindowsMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files
  • C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Files
  • This list will grow as if you have other versions of the framework installed.


    I had to clear

    C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files

    Only then did the issue get resolved.

    链接地址: http://www.djcxy.com/p/56938.html

    上一篇: 将svg转换为图像的库?

    下一篇: 无法加载文件或程序集...该参数不正确