最近我在 C# 解决方案中遇到了以下异常:
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))
这既不取决于我的代码也不取决于程序集的名称(在本例中为 Newtonsoft.Json
)。
当我从解决方案中删除此 dll 时,编译器会在同一异常中告知另一个。所以我想应该在我的电脑上关闭/打开某些东西:)
最佳答案
看起来像是引用了损坏的程序集。
清除两者:
项目的\bin 文件夹
临时文件夹(在 Windows 7 中应该是
C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET Files
)
看看错误是否仍然发生
关于c# - 无法加载文件或程序集...参数不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8269386/