?
Solved

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

Posted on 2011-10-17
7
Medium Priority
?
1,857 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:FrancineTaylor
  • 5
  • 2
7 Comments
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 36983328
Did you try to simply remove a reference and then create a new one pointing to a new executables/libraries?
0
 
LVL 1

Author Comment

by:FrancineTaylor
ID: 36987166
Just tried that, still getting the error.
0
 
LVL 1

Author Comment

by:FrancineTaylor
ID: 36987587
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
FrancineTaylor earned 0 total points
ID: 36988241
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
 
LVL 1

Author Comment

by:FrancineTaylor
ID: 36988349
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
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 36988483
Interesting info, thanks!
0
 
LVL 1

Author Closing Comment

by:FrancineTaylor
ID: 37013585
Figured it out on my own...
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question