PC [HELP] Game will not launch

Lity

Greenhorn
This is a problem I have seen a lot of people have but still no answers.

So I've been having a long running issue of my game not running. I have gone through all the basic troubleshoots, including because I will be asked... Restart your computer. Make sure you have speakers or headphones plugged in. (They can be muted, but the game needs a working audio device.) If you play on Windows: Install (or reinstall) .NET Framework 4.5.2 and XNA Framework 4.0 Reinstalled and repaired C++. I have SMAPI installed, it cannot boot through that either. I try to find the crash logs, but when I do the search through the run prompt with "%appdata%\StardewValley\ErrorLogs" I get a prompt saying that the Error Logs cannot be found. There are no error log folders. When I attempt to open through SMAPI, this is the message I am given:

SMAPI failed to initialize: 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)
File name: 'Microsoft.Xna.Framework.dll'
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.AssertGamePresent() in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 76
at StardewModdingAPI.Program.Main(String[] args) in C:\source\_Stardew\SMAPI\src\SMAPI\Program.cs:line 30

I have uninstalled Framework 4.0 and reinstalled then repaired even, still no fix. I have rewound to an earlier version of windows, still no fix.

I know this is alot of text, but I am trying to be as detailed as possible so this unresolved issue can be figured out.
 
Last edited by a moderator:

Lity

Greenhorn
I was able to find help from someone through the Discord server for Stardew Valley. After several hours, we were able to come up with a solution to the error and I can play Stardew again. I know this is an issue many players have experienced and no answers have been solidly formed yet so this is what we did. This post was written by the person who had helped me past this point.

Okay, so. Upon searching for the error specifically enough I eventually found this needle in the haystack that is Google: https://superuser.com/questions/1069506/how-to-fix-badimageformatexception-on-application-startup Going through the same steps as them it was evident that the latter part of the error message "Could not load file or assembly 'Microsoft.Xna.Framework.dll' or one of its dependencies. is not a valid Win32 application." pointed out that one of the dependencies of 'Microsoft.Xna.Framework.dll' was the actual culprit. The only problem was trying to figure out which one. Also important to note is that reinstalling XNA was not useful in this case, as the files from XNA itself were fine. By using a program called Dependencies (https://github.com/lucasg/Dependencies) and opening the XNA dll file we saw that there was an actual dll that was either missing or had trouble loading. In this specific case it was 'msvcp100.dll'. This is supposedly a file from Microsoft Visual C++ 2010. So we tried to reinstall and repair these packages. This did not fix the issue. We tried a few other things in the meanwhile, but it wasn't until we made a last ditch effort to brute force a fix by replacing possibly faulty dll's with dll's from my own computer (which was able to run SDV) the game started working again when we replaced 'msvcp100.dll'.(edited)

So if anyone runs into this issue, has done everything that was mentioned in the post above, and still refuses to work I suggest doing the following: Get the program Dependencies from the link above. Open your XNA dll. This is likely located in C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework\v4.0_4.0.0.0__842cf8be1de50553\ (It's possible; much like in the superuser post linked above, that this is not the same location for you. To find it I'd suggest using dotPeek and open StardewValley.exe and look at the properties of Microsoft.Xna.Framework inside of the References to see the location) Then in this list see if any of the dll's are not loading. These are the dll's you'll likely have to replace. Do get the necessary dlls you need from someone you trust whose game does work, as downloading a dll from a random place on the internet could end up very badly. In the superuser post the culprit was 'X3DAudio1_7.dll', and in our case it was 'msvcp100.dll'. I personally think that the only other it could be is 'msvcr100.dll', as any of the other dlls seem to be system sensitive and would have broken more than just your game. I suspect that when you run into this error replacing all of these should fix the problem.
 

Kirman

Newcomer
Hi bro, I'm having the same kind of trouble, but i really can't understand the steps of your solution, i guess that if i do it, it will work, as it's the same exact problem. If you don't have any problem, add me on Discord, so i may contact you so you may help me with this problem :awe:}
We're trying to play with my GF and she's having this problem idk why.

My discord: Kirman#6064
 

synlyss

Newcomer
For anyone else having this problem, opening CMD as administrator and running the command 'sfc /scannow' and restarting afterwards, combined with the fix above worked for me
 
Please be aware that Mac is different to windows.
Could you post an error log if possible? @Cassialli

Also, try to follow this instruction.
 
I have some questions
Are you using a mod?
If you do, you should get help and create a new thread from the mod support.

I am familiar with Microsoft XNA. – I am surprised that you got a Microsoft XNA error from Mac.... – I am learning something new here.
If you do not have a mod installed, I suggest following this instruction for the Mac User section in the instruction.
 
I do have mods installed. I installed Mono Framework so the mods could work. It might be a problem with that.
I am not familiar with the mods.
It is possible that the mods can or cannot be a problem.
According to your SMAPI, your mods is part of the problem.
I suggest creating a thread from Mod Support. –These technicians can fix it without removing your mods.


 

small bread

Newcomer
Please be aware that Mac is different to windows.
Could you post an error log if possible? @Cassialli

Also, try to follow this instruction.
Hey, I'm on windows but having a similar issue, do you think you can try to help?
 
Hey, I'm on windows but having a similar issue, do you think you can try to help?
If, for any reason, you want to play on the “legacy” 32-bit version, it’s still available on Steam (right click Stardew > properties > betas > select “Compatibility” version).
I am not sure you are playing on Stream.
Could you try follow this instruction?
Play the 32 bit version instead of 62.
 

Ayali

Greenhorn
Alright. In my case I was able to fix it. :) (hopefully without any new issues later :D)
Removed smapi, reinstalled Stardew (I even deleted some saves, bc some would only make my game crash now. bye bye.) - the basic mod-free game without smapi worked fine. Then I reinstalled smapi with the auto-install in the smapi folder BUT, which I overlooked, I had to install .net 5 runtime/core (or something like that) for windows apparently. It was mentioned in the auto-install-file of smapi. It was successful and now I can launch it without any problems. I only need to update/fix/adapt some mods. So maaaaybe this could help someone. :>
 
Top