none
x86 on x64 : An attempt was made to load a program with an incorrect format

    Question

  • I have VS2010 running on Win7 x64 to do debugging I have to compile in x86.  One of my projects is throwing an error when I switch to x86 mode, in any CPU it works fine but I can't debug correctly, error below.  When I click on the error it shows me one of the files resource (resx) and the data for an image stored there.

    any suggestions on how to fix?

    Error 1 

    Could not load file or assembly 'file:///C:/D-Drive/FRS4/DBChecker/bin/x86/Debug/DBChecker.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 465, position 5. C:\D-Drive\FRS4\FRS4_UI\Login.resx 465 5 FRS4_UI

    data location is last </data>  (note some data clipped for size)

      <data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>
            AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
            Av8BgAEAAf8B+AIAAQ8B/AEPAeMB/wHgAQABBwL/AeABAwH/AfwCAAEfAf8BHwL/AeABAAEPAv8B+AEP
            Af8B/gIAAX8E/wHmAQABHwL/AfwBHwL/AYABAAX/AfABfwf/AeABBxH/Cw==
    </value>
      </data>


     


    John J. Hughes
    www.functioninternational.com/
    • Moved by Brittany Behrens Tuesday, June 29, 2010 2:21 AM Error on debugging (From:Visual Studio Editor)
    Monday, June 28, 2010 11:10 PM

All replies

  • Hello,

    Can you run your program without debugging? Please try to run it first and then attach the process to Visual Studio Debugger to debug your source code.

    To narrow down the issue, if you create a new project, does the issue persist? If possible, please provide a detail step to reproduce the issue.

    Thanks a lot!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Wednesday, June 30, 2010 5:35 AM
  • Roahn,

    Sorry I was not clear.  I get the error when I compile, can't get as far as running it.  No it does not compile in release mode either.

     


    John J. Hughes
    www.functioninternational.com/
    Wednesday, June 30, 2010 5:44 AM
  • Hello,

    What kind of project are you dealing with? Please let us know what your scenario, that's would be more helpful to diagnose the issue. I found a blog which talked about a similar issue, hope it could help you:
    http://blog.crowe.co.nz/archive/2007/11/05/Could-not-load-file-or-assembly-name-or-one-of.aspx

    Best regards 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Wednesday, June 30, 2010 7:29 AM
  • Hello,

    It is a basic forms website using C# and .NET 3.0.  It seems to be the image in the resource file causing the problem.  I have several projects in the solution and this is the only error. 


    John J. Hughes
    www.functioninternational.com/
    Wednesday, June 30, 2010 2:01 PM
  • Did you ever get this issue fixed?  I have the same issue and have found a way to fix it.

    Let me know1

    Tuesday, August 16, 2011 7:37 PM
  • Paul Beaul,

    I replaced the file from backup and it was fine.  It does not happen often but that seems to be the only solution.


    John J. Hughes II
    www.functioninternational.com
    Tuesday, August 16, 2011 8:21 PM