1. This forum is archived for reference. For support & bug reports visit the help section of forums.stardewvalley.net

BadImageFormatException

Discussion in 'Support' started by iSanyu, Jan 4, 2018.

  1. iSanyu

    iSanyu Space Hobo

    So I've googled this, followed all these guides on how to fix the issue, and nothing has seemed to work. I know it was posted here before but the topic ended abruptly and there didn't seem to be any resolution. Whenever I try to run Stardew Valley on steam it says "Running" for a few seconds before going back to normal.

    Going into my event viewer shows:

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

    Error 2:
    Faulting application name: Stardew Valley.exe, version: 1.2.6400.27469, time stamp: 0x59638c0d
    Faulting module name: KERNELBASE.dll, version: 10.0.15063.726, time stamp: 0x32774c02
    Exception code: 0xe0434352
    Fault offset: 0x000ecbb2
    Faulting process id: 0xff8
    Faulting application start time: 0x01d3851899203e44
    Faulting application path: C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Stardew Valley.exe
    Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
    Report Id: dbfeee18-42d1-4db2-b5b1-ffa5ea7b0bd6
    Faulting package full name:
    Faulting package-relative application ID:

    So far the solutions that I've found and done are:
    - Uninstall & Reinstall
    - Run as administrator
    - Run in compatibility mode
    - switching the spots of the X3DAUDIO1_7.DLL files for the 64-bit windows
    - reinstalling the XNA files
    - the .NET says I can't install it because the most up to date version is added.

    I can run more taxing games, so I know its not my pc not able to handle such a game, anyone have this issue that fixed it in a way different than all those?


    EDIT: downloaded Terarria to check something and it has the exact same issue.
     
      Last edited: Jan 4, 2018
      Hinayuna likes this.
    • Pathoschild

      Pathoschild Tiy's Beard

    • iSanyu

      iSanyu Space Hobo

      Unfortunately theres no error log folder in my stardew valley appdata folder. When I start it it creates the cmd window, then posts:

      Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Xna.Framework.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
      at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
      at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
      at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
      at System.Type.GetType(String typeName, Boolean throwOnError)
      at StardewModdingAPI.Program.AssertMinimumCompatibility() in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 294
      at StardewModdingAPI.Program.Main(String[] args) in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 97

      And then it crashes.
       
        Hinayuna likes this.
      • Pathoschild

        Pathoschild Tiy's Beard

        @iSanyu Try this:
        1. Uninstall XNA Framework.
        2. Run C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\_CommonRedist\XNA\4.0\xnafx40_redist.msi to install the specific version the game uses.
        3. Restart your computer.
        4. Try to launch the game.
        Does the problem still happen then?
         
        • iSanyu

          iSanyu Space Hobo

          Yes, I uninstalled it and tried to reinstall but I needed to have visual studio 2010 so I downloaded that as well, reinstalled XNA, same issue.
           
          • Pathoschild

            Pathoschild Tiy's Beard

            You ran that specific installer, you didn't download XNA Framework yourself?
             
            • iSanyu

              iSanyu Space Hobo

              I've done both actually, the first time I ran that specific installer, when that didn't work I uninstalled it and re-installed it using the microsoft website.
               
              • Pathoschild

                Pathoschild Tiy's Beard

                @iSanyu Which version of Windows do you have?
                 
                • iSanyu

                  iSanyu Space Hobo

                  Windows 10, 64 bit.
                   
                  • Pathoschild

                    Pathoschild Tiy's Beard

                  • Hinayuna

                    Hinayuna Void-Bound Voyager

                    I had the same Issue as iSanyu and tried every fix I found
                    (I was trying to run the game on a Windows 10 64 bits)

                    so I found a post about this same issue: [link]
                    And the same person having this issue posted a solution that worked for him:
                    I tried this and it worked for me too! The game is opening now

                    But be careful to not mess up the Windows sysWow64 and system32 folders and do this procedure at your own risk!

                     
                      Last edited: Jan 15, 2018
                      Pathoschild likes this.
                    • juljimmy1

                      juljimmy1 Space Spelunker

                      I have the same problem too! [​IMG] i did everything reinstall everything(except for the stardew valley since i can't update it to v1.3 i lost my steam authneticator) im using the Smapi 2.5 its wsa working before but after months of not playing and i tried to play the the game yesterday i have this error there;s no error logs on the appdata or i reinstall the XNA switch the X3daudio
                       

                        Attached Files:

                      • juljimmy1

                        juljimmy1 Space Spelunker

                        Wait mine is actually STARDEW VALLEY not XNA! so how do i fix it?
                         
                        • Pathoschild

                          Pathoschild Tiy's Beard

                          @juljimmy1 That usually happens due to...
                          • a virus on your computer changing Stardew Valley.exe;
                          • or using some pirated versions of the game which change Stardew Valley.exe for some reason.
                          If a virus scan doesn't find anything and you're not using a pirated version, you can ask for help in #support on the Stardew Valley Discord.
                           
                            Hinayuna likes this.
                          • juljimmy1

                            juljimmy1 Space Spelunker

                            Thanks got it Fixed i scan my pc there's a virus called Ground exe now i can play it! thanks for the reply ^^
                            it renames the program to gStardewvalley.exe maybe that's why i cant play some of my games like League and PUBG.
                             
                              Last edited: Jun 11, 2018
                            • chaitanyar

                              chaitanyar Space Spelunker

                              Hey I am getting a similar issue please help


                              Screenshot (125).png

                              This also seems to happen with most other mods
                               
                                Last edited by a moderator: Jan 23, 2022
                              • Pangaea

                                Pangaea Forum Moderator

                              Share This Page