Cannot load assembly (hr = 0x80131018)

大兔子大兔子 提交于 2019-12-11 01:55:47

问题


I have a user with issues loading a .Net assembly into AutoCAD. I get the following error:

Cannot load assembly. Error details: System.BadImageFormatException: Could not load file or assembly (hr = 0x80131018)

They are using an anit virus package called Endpoint Security and when this is turned off, the load works.

I am not a .Net expert and was hoping there might be a friendlier solution than me suggesting the user put their anti virus package in the trash!? But I've no idea where to start, any help would be greatly received.


回答1:


System.BadImageFormatException can happen if you are mismatching x86 / AnyCpu. Try to compile your assembly in x86 mode explictly and see what happens.




回答2:


In my case it was resource dll with Native Code whyle expected .NET resource dll. When I slip right one - everything become ok.



来源:https://stackoverflow.com/questions/11654193/cannot-load-assembly-hr-0x80131018

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!