问题
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