Everytime I revert a commit in my project using GitHub desktop I get the following error when I'm trying to debug:
每次我使用GitHub桌面在我的项目中恢复提交时,我在尝试调试时都会收到以下错误:
"An unhandled exception of type 'System.BadImageFormatException' occurred in Unknown Module.
Duplicate type named "Costura.AssemblyLoader" in assembly "Project, Version=1.0.5.0, Culture=neutral, PublicKeyToken=null"".
(I translated it because my Visual Studio is in german)
(我翻译它,因为我的Visual Studio是德语)
The only thing that helps is repairing or updating Visual Studio through the Installer. When I delete the revert the error still shows up. I'm using Visual Studio 2022 and the project is a .net 4.7.2 c# application.
唯一有帮助的是通过安装程序修复或更新Visual Studio。当我删除恢复时,错误仍然出现。我使用的是Visual Studio 2022,该项目是一个.Net 4.7.2 c#应用程序。
更多回答
优秀答案推荐
"System.badimageFormatexception" type of unprocessed abnormalities occur in xxxx.exe
Xxxx.exe中出现“System.badimageFormatException”类型的未处理异常
Other information: Failure to load files or assembly "xxxxxxx, versions = xxxxxxx, xxxxxxx" or one of its dependencies. Trying to load program with an incorrect format.
其他信息:无法加载文件或程序集“xxxxxxx,Versions=xxxxxxx,xxxxxxx”或其依赖项之一。正在尝试加载格式不正确的程序。
The reason is that the target platform of the "target program is inconsistent with the target compilation platform of the dependencies. It is modified to compile all the projects to the same target platform (X86, X64, or AnyCPU), which can generally solve the problem".
原因是“目标程序的目标平台与依赖项的目标编译平台不一致。它被修改为将所有项目编译到同一个目标平台(X86,X64或AnyCPU),这通常可以解决问题。
Right -click item => Properties => Build => Platform target
右键单击Item=>Properties=>Build=>Platform Target
If the above method cannot be solved, the following ways can be used:
如果上述方法不能解决,可以使用以下方法:
Right -click solution => process => Configuration Properties => Configuration Manager
右键单击解决方案=>流程=>配置属性=>配置管理器
更多回答
我是一名优秀的程序员,十分优秀!