none
[UWP]System.BadImageFormatException when starting UWP app on Remote PC RRS feed

  • Question

  • Hi,

    I have deployed a UWP app to run with Sideloading on a remote machine but after running the app I get this error:

    Application: Al-Sadiq.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.BadImageFormatException
    
    Exception Info: System.BadImageFormatException
    

    The same app works perfectly on my PC.

    How can I fix this please?

    Thanks,

    Jassim


    Saturday, September 7, 2019 1:16 AM

All replies

  • Hi,

    First of all, could you please tell me what's the OS version of the remote device and what's the target version of your app? Also, what about running a blank app on the remote machine?

    According to this document:BadImageFormatException Class, there are different causes for the exception and I suspect the reason for your scenario is that "The components of your application target different platforms. For example, you are trying to load ARM assemblies in an x86 application. " I suggest you to check the target platform of your app and change it to the right platform of the remote device.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, September 9, 2019 2:18 AM
    Moderator
  • Hi Roy,

    This is remote PC version:

    and this is my Minimum Target:

    Just in case it makes a difference, my target machine is a WIndows Developer ISO on Oracle VirtualBox

    Thanks,

    Jassim

    Monday, September 9, 2019 2:51 AM
  • Answering the other part of your question, Yes even Blank UWP app throws the same error
    Monday, September 9, 2019 9:03 AM
  • Hi,

    What I mean in my last reply is that maybe your app is targeting x86 and the system is x32 so that the target platform doesn't match. Could you please check that?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, September 10, 2019 12:46 AM
    Moderator
  • Nope Roy

    The app is target x86 as you can see in the above screenshot

    and the system is x64


    • Edited by Jassim Rahma Tuesday, September 10, 2019 7:22 AM
    Tuesday, September 10, 2019 7:22 AM
  • Hi,

    Is there an error code for this? That might be helpful. Also as you mentioned that the a blank app will also give this error, right? It seems the problem might be related to the environment. Is there virtual machine to test?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 11, 2019 6:28 AM
    Moderator
  • I am already using Oracle VirtualBox where the error is thrown.

    In addition to the above error, I am getting this error:

    Faulting application name: BlankUWP.exe, version: 1.0.0.0, time stamp: 0x5d75bab6
    Faulting module name: KERNELBASE.dll, version: 10.0.17763.652, time stamp: 0x57e2061a
    Exception code: 0xe0434352
    Fault offset: 0x0011fd82
    Faulting process id: 0xa14
    Faulting application start time: 0x01d566ed20e40bc0
    Faulting application path: C:\Program Files (x86)\Your Company\Your Application\BlankUWP\BlankUWP.exe
    Faulting module path: C:\Windows\System32\KERNELBASE.dll
    Report Id: e9dd4b47-0b28-49d4-a398-ff4e8446efca
    Faulting package full name: 
    Faulting package-relative application ID: 

    Wednesday, September 11, 2019 11:47 AM
  • Hi,

    Sorry to confused you, I mean find another visual machine to test, not the current one. If the problem doesn't show, the problem will be more related to the environment. I checked the error code, but it doesn't give some useful information about this. 

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 12, 2019 1:34 AM
    Moderator