“An attempt was made to load a program with an incorrect format” even when the platforms are the same

前端 未结 20 2928
悲&欢浪女
悲&欢浪女 2020-11-22 13:57

I\'m calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is:

BadImageFormatException: An attempt was made to load a program w

20条回答
  •  日久生厌
    2020-11-22 14:21

    Also see this answer, which solved the same problem for me.

    Posted by Luis Mack on 5/12/2010 at 8:50 AM I've found the same problem, only for a specific project when compiling on a 64-bit machine. A fix that SEEMS to work is to manually alter one character in the image stream EVERY TIME the usercontrol or form is edited in the designer

     AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
    

    Change to

     AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
    

    That is 00LjAuMC4w back to 0yLjAuMC4w at the end of the line (00 back to 0y)

提交回复
热议问题