Reputation: 455
I've recently made a release build of a demo game. I've tested it on all my machines at home, a combination of Windows 7 and Windows 8 machines, all 64 bit operating systems.
I passed the demo to a friend who said it is crashing on his machine.
I've built the game as an x86 release so it should work in most Windows environments. As a test I loaded it up here at work and it also fails. I'm combing logs to try and work out why it is failing but don't quite understand the issue if someone could have a look for me.
According to the registry I do have a version of .NET 4.5.1 installed which is good. My .NET crash log provides the following error.
Application: Monochromia.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException Stack: at Monochromia.Program.Main(System.String[])
I've had a look at my main Method (which again works on other machines) and it looks as follows:
using System;
namespace Monochromia {
#if WINDOWS || XBOX
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}
#endif
}
Is there anywhere I can go to find out specifically which file is missing? So I can try and work out why it is breaking. As a I said this is working fine on about 4-5 other machines I have run it on and I imagine there is a common element missing on other machines but I am not sure where to start looking to find out the missing element.
If it helps here is an actual crash log from the game:
Version=1
EventType=APPCRASH
EventTime=130597875140383880
ReportType=2
Consent=1
ReportIdentifier=91cf3b49-6606-11e4-93c4-c8600067af2a
IntegratorReportIdentifier=91cf3b48-6606-11e4-93c4-c8600067af2a
WOW64=1
Response.type=4
Sig[0].Name=Application Name
Sig[0].Value=Monochromia.exe
Sig[1].Name=Application Version
Sig[1].Value=1.0.0.0
Sig[2].Name=Application Timestamp
Sig[2].Value=5459faaf
Sig[3].Name=Fault Module Name
Sig[3].Value=KERNELBASE.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=6.1.7601.18409
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=53159a86
Sig[6].Name=Exception Code
Sig[6].Value=e0434352
Sig[7].Name=Exception Offset
Sig[7].Value=0000c42d
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=6.1.7601.2.1.0.768.3
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=3081
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=0a9e
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=0a9e372d3b4ad19135b953a78882e789
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=0a9e
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=0a9e372d3b4ad19135b953a78882e789
UI[2]=C:\Users\Admin1\Downloads\Release\Monochromia.exe
UI[3]=Monochromia has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Users\Admin1\Downloads\Release\Monochromia.exe
LoadedModule[1]=C:\Windows\SysWOW64\ntdll.dll
LoadedModule[2]=C:\Windows\SYSTEM32\MSCOREE.DLL
LoadedModule[3]=C:\Windows\syswow64\KERNEL32.dll
LoadedModule[4]=C:\Windows\syswow64\KERNELBASE.dll
LoadedModule[5]=C:\Windows\syswow64\ADVAPI32.dll
LoadedModule[6]=C:\Windows\syswow64\msvcrt.dll
LoadedModule[7]=C:\Windows\SysWOW64\sechost.dll
LoadedModule[8]=C:\Windows\syswow64\RPCRT4.dll
LoadedModule[9]=C:\Windows\syswow64\SspiCli.dll
LoadedModule[10]=C:\Windows\syswow64\CRYPTBASE.dll
LoadedModule[11]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
LoadedModule[12]=C:\Windows\syswow64\SHLWAPI.dll
LoadedModule[13]=C:\Windows\syswow64\GDI32.dll
LoadedModule[14]=C:\Windows\syswow64\USER32.dll
LoadedModule[15]=C:\Windows\syswow64\LPK.dll
LoadedModule[16]=C:\Windows\syswow64\USP10.dll
LoadedModule[17]=C:\Windows\system32\IMM32.DLL
LoadedModule[18]=C:\Windows\syswow64\MSCTF.dll
LoadedModule[19]=C:\PROGRA~2\KASPER~1\KASPER~1\mzvkbd3.dll
LoadedModule[20]=C:\PROGRA~2\KASPER~1\KASPER~1\sbhook.dll
LoadedModule[21]=C:\Windows\syswow64\ole32.dll
LoadedModule[22]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
LoadedModule[23]=C:\Windows\system32\MSVCR110_CLR0400.dll
LoadedModule[24]=C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\ce5f61c5754789df97be8dc991c47d07\mscorlib.ni.dll
LoadedModule[25]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
LoadedModule[26]=C:\Windows\syswow64\OLEAUT32.dll
LoadedModule[27]=C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=Monochromia
AppPath=C:\Users\Admin1\Downloads\Release\Monochromia.exe
Upvotes: 0
Views: 712
Reputation: 455
It seems my issue was that the target system although having the .NET Framework did not contain the XNA Framework from http://www.microsoft.com/en-us/download/confirmation.aspx?id=27598. The reason that I picked this up was that I was looking at other bug reports from other games and noticed people having issues with Terraria which was made with XNA. It made me realise the other target machines I had tested earlier had played Terraria at some point and thus would have had the XNA Framework installed when the game was first run.
I may have to look at bundling this in an installer or doing a check for the Framework first. Problem solved!
Upvotes: 1
Reputation: 10708
The code causing this exception is most likely linked to the disposal of the game
object. Note that using
an object calls IDispose.Dispose()
after the using
block, which would explain why this happens during shutdown. This should go away if you wrap the using
statement in a try-catch
block, but it may not help diagnose the problem.
For diagnosis, I would recommend debugging on the target machine so you can get the full stack trace of the exception, and barring that, make a release Console build, and wrap the using
in a try-catch
as above, but slam the Exception.StackTrace into the console window for viewing.
try
{
using (Game1 game = new Game1())
{
game.Run();
}
}
catch(Exception E)
{
Console.WriteLine(e.StackTrace);
}
Note that it might also be helpful to give your tester a debug build so that the stack trace or other exception data isn't optimized away.
Upvotes: 0