locked
"An attempt was made to load a program with an incorrect format" error when deploying to WP8 RRS feed

  • Question

  • I have a WP7.1 project that i can't deploy to WP8 (Emulator or Device). When i do i get the following error.

    So far i have tried

    • Converting to a WP8 app but had no luck (i rolled this change back)
    • Upgrading VS2012 to update 2
    • Installed Windows Phone 7.8 SDK
    • Deploying to a WP7 VM - This works 
    • Deploying to a WP8 VM - Fails with this error but the OS loads
    • Deploying to a WP7 device - This works
    • Deploying to a WP8 device - Failes with this error
    • Created a new 7.1 project and manually copied all classes and third part dll's - Still fails with this error

    more details of what i have tried so far are on my stackoverflow question

    http://stackoverflow.com/questions/16040038/cant-deploy-windows-phone-app-an-attempt-was-made-to-load-a-program-with-an-i

    As you can see the error is not very helpful to locate the cause of the problem. Can anyone suggest something to help narrow down the problem?


    • Edited by Nitro52 Friday, April 19, 2013 9:29 AM
    Friday, April 19, 2013 9:28 AM

All replies

  • Hi,

    After converting the app to a WP8 app, have you tried deleting and then re-adding all the References, to ensure your app uses the newer libraries? Also Clean the project and make sure there are no stray DLLs in your solution, before recompiling?

    -Mark


    Getting Started? Click here
    Blog: Windows Store & Phone Developer Solutions

    Monday, April 22, 2013 4:30 PM
  • Hi, 

    I have the same error and i made many trials and the error still happens . Do you solve this error ?

    Thanks a lot :)

    Nada Gamal 

    Saturday, October 12, 2013 10:25 AM
  • Any Solution for this problem 

    DesertQueen

    Wednesday, May 7, 2014 2:57 PM
  • This error happens when your app targets the wrong CPU type. For example, if you target x86 but you have a 64-bit CPU.

    You can fix it by following the following steps:

    • Open project properties window
    • Select Build tab
    • Change it to ‘Any CPU’
    • Save your changes.
    • Compile your project and run :)

    Hope this helps!

    Cheers,
    Paras Wadehra
    http://twitter.com/ParasWadehra
    Microsoft MVP
    Microsoft Developer Ambassador
    INETA Community Champion


    Paras Wadehra Twitter: @ParasWadehra (Nokia Developer Ambassador)

    • Proposed as answer by ParasWadehra Thursday, May 8, 2014 4:12 AM
    Thursday, May 8, 2014 4:11 AM
  • All my projects olny have one option, "Any CPU". i guess it could be a dependency dll i am referencing but how can you tell what CPU type a dll targets?
    Thursday, May 8, 2014 10:50 AM