Atalasoft error: attempt made to load a program with an incorrect format

My company has used Atalasoft for as long as I've been here, almost a year, and just recently we started getting this error.
 
It is a very large application, with a couple of dozen modules, each in its own solution.  The project that I'm working on is the only one which uses Atalasoft.  If I check a fresh copy of the project out of Subversion, it compiles just fine.  But if I open one of the Windows Forms in the designer and save it, then compile, I get this error: "Could not load file or assembly 'file:///ThirdParty/Atalasoft/DotImage 9.0/Atalasoft.DotAnnotate.dll' or one of its dependencies.  An attempt was made to load a file with an incorrect format"

DotAnnotate is the first of the references in my project file and if I switch the order it still fails on the first reference to Atalasoft.

When I check the saved version against the original in Subversion, I can see that some of the form controls' locations were changed, though I didn't deliberately change anything.  Some of the lines which Subversion thinks were changed look exactly the same to me.  There were other syntax changes, order changes, etc.

Any ideas as to how to get the error to go away?  We are running VS 2008, Net 3.5 and the version of Atalasoft is for net 2.0 (since they only have 2.0 and 4.0 and we haven't yet migrated to 4.0).

I have tried setting Enable 32 bit application to true for IIS Application Pools.  I have tried compiling for x86 instead of Any CPU.  Nothing has worked so far.
LVL 1
FrancineTaylorAsked:
Who is Participating?
 
FrancineTaylorConnect With a Mentor Author Commented:
Okay, I figured it out.  It is caused by a bug in Visual Studio 2010, which causes an extra letter to be inserted at the beginning of each block of embedded resource in a windows form .resx file.

In order to fix it, you need to manually edit the .resx file each time you save the form after altering it with VS 2010 Designer.  Because I am using Subversion, I can just do a compare with the saved (uncorrupted) version.  At the beginning of each block of resource, the first line will be marked as changed.  If you do a character-by-character comparison, you will find an extra letter that shouldn't be there (can't remember what but I think it might be a 'y').  Just use the original from Subversion to restore that line to its original form.

This bug is a real pain, as you will have to do the manual editing every time you make changes with the designer.
0
 
anarki_jimbelCommented:
Did you try to simply remove a reference and then create a new one pointing to a new executables/libraries?
0
 
FrancineTaylorAuthor Commented:
Just tried that, still getting the error.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
FrancineTaylorAuthor Commented:
Further research reveals that the problem seems to be that the very act of opening a form causes some kind of corruption in the embedded resources (ImageStream, DataSource).  Still trying to figure out why or how to fix it...
0
 
FrancineTaylorAuthor Commented:
Here's the fix in a bit more detail; look for all the embedded resource blocks in the .resx file.  Most of them should have the 71st and 72nd characters changed to "00".  They *should* be "0y".  If you make that change, the file should compile.  If it still doesn't compile, check again, you may have missed one.
0
 
anarki_jimbelCommented:
Interesting info, thanks!
0
 
FrancineTaylorAuthor Commented:
Figured it out on my own...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.