What can lead to the correct compilation of the .resx file in Windows XP, but with error 137 in Windows 7 64 bits?

I came across a very strange scenario. My solution has a .resx file that is causing problems.

Using Visual Studio 2010 running Windows XP, the solution compiles without problems.

Using Visual Studio 2010 running Windows 7, 64 bit, the same solution reports a build failure with error 137

An attempt was made to load a program with an incorrect format. Line 204, position 5. [Path Sanitized]\RemoteFileView.resx

The resource file in question appears to be valid, so I find it difficult to explain the problem.

Can anyone suggest what could have gone wrong?

Clarification: the line in question in VS 2010 is a simple </data> element. XML seems to be well formed.

+4
source share
3 answers

Based on the line in the error message, a BadImageFormatException appears when the designer tries to load.

It seems very likely that this is a bit mismatch problem. Did you try to restore the solution? Can you build a command line through MSBuild? Are all your projects focused on “Any processor”, or do you have a specific processor?

Please take a look at this blog post , where Sarah Stolyar describes the circumstances in which you can consider this issue in detail.

+4
source

I also had the same issue when porting my system to 64-bit. The only solution for me was that every time I changed something in gui and resx files, I had to do the following:

Replace all occurrences of string j00L with j0yL .

Now you can compile!

+2
source

This is a bug with Visual Studio that Microsoft has been aware of for over a year now. See the links below for more information:

Recently, I had to upgrade our Windows forms project to .NET 4.0, because as soon as we touched (read saved) the designer, he distorted our built-in images. The error line was just a load of locks.

Unfortunately, none of the suggested workarounds worked for us, so we had to bite the bullet and update.

+1
source

Source: https://habr.com/ru/post/1338440/


All Articles