System.BadImageFormatException RRS feed

  • Question

  • Hi,

    I use TaskManager to run my exe periodically. It works without any problems but suddenly throw an exception as below.

    Do you have any idea?


    Application: XXX.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.BadImageFormatException
       at XXX.Program.Main(System.String[])

    • Edited by Aysegul Kara Thursday, November 15, 2012 9:27 PM
    Thursday, November 15, 2012 9:22 PM


  • BadImageFormatException is mainly due to 32 bit/64 bit config mismatch.

    Are you using any COM based dll in your project ?
    is your OS 64 bit or 32 bit one?
    Have you built your application 'Any CPU' configuration?

    I suggest you to change the Target Platform to 'x86' and then run your project.

    I hope this helps.

    Please mark this post as answer if it solved your problem. Happy Programming!

    • Proposed as answer by Mike Feng Friday, November 16, 2012 4:26 PM
    • Marked as answer by Aysegul Kara Friday, November 16, 2012 7:04 PM
    Friday, November 16, 2012 9:02 AM