最近我在c#解决方案中遇到了以下异常:

错误2无法加载文件或程序集'Newtonsoft。Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6'或 它的依赖项之一。参数不正确。(例外 HRESULT: 0x80070057 (E_INVALIDARG))

这既不取决于我的代码,也不取决于程序集的名称(如Newtonsoft)。Json)。

当我从解决方案中删除这个dll时,编译器会在相同的异常中告诉另一个dll。所以我想我的电脑应该关闭/打开一些东西:)


当前回答

从源代码控制处获得一组新的二进制文件会有所帮助。

谢谢

其他回答

我在这里遇到了同样的问题——上面的解决方案不起作用。问题出在ActionMailer上。我运行了以下卸载和安装nuget命令

uninstall-package ActionMailer
install-package ActionMailer

解决了我的问题,希望能帮助到别人。

如果您正在使用SQL Server 2012的数据工具,在2013年5月1日使用VS2010 shell,请检查您的配置管理器设置。将服务器名称从Workflow更改为xCPWorkflow足以产生完全相同的参数不正确(Exception from HRESULT: 0x80070057 (E_INVALIDARG))消息。

我在IIS上运行的“Chocolatey服务器(简单)”也有同样的问题,必须执行以下步骤

Clean the "C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files" as recommended Uninstall the "Chocolatey Server (Simple)" application via choco Remove the directory "C:\tools\chocolatey.server" from the chocolatey package directory. Important, because otherwise Web.config is holding old dependencies which leads to the error. A simple re-installation will not update an existing Web.config (as it was in my case). Restart IIS and config Chocolatey Server as recommended by the authors. The chocolatey server page should now be visible without any errors.

看起来像是引用了一个损坏的程序集。

明确的两个:

项目的\bin文件夹 临时文件夹(应该是C:\Users\your_username\AppData\Local\ temp \Temporary ASP。windows 7中的NET文件

看看错误是否仍然发生

您可以清除、构建或重新构建应用程序,也可以简单地删除临时ASP。C:\Users\YOUR USERNAME\AppData\Local\Temp

这就像魔法一样。在我的情况下,我有一个程序集绑定问题说无法加载文件bla bla bla

你也可以看到解决方案2为http://www.codeproject.com/Articles/663453/Understanding-Clean-Build-and-Rebuild-in-Visual-St