Could not load file or assembly … or one of its dependencies. An attempt was made to load a program with an incorrect format (.resx file)

后端 未结 4 704

I am getting the following error message when compiling or attempting to run my application on Windows 7 64 bit. I\'ve scoured the Internet and many people have the same err

4条回答
  •  庸人自扰
    2020-12-13 06:55

    I have run into the same problem with one of my programs. The issue is that for some reason the Visual Studio appears to be generating 64 bit data blocks for some of the GUI control properties, which it is then unable to load when compiling to x86.

    In my case, I am able to work around the problem by deleting the problamatic data blocks from the resx file along with the line code lines in the cs.designer file that reference those blocks. I am able to do this as the corresponding source code lines that are assigning the referenced property are redundant and not needed. The only annoying thing is that I have to redo those fixes each time I modify anything in the designer, as Visual Studio then adds back in the bad code.

提交回复
热议问题