I've been developing a game and after each update I send my friend a setup.exe to use I made with Inno Setup. It's always worked fine up until now. He is able to instal the game but when he runs the .exe he gets "Game has stopped working". While it works fine for me after installing. The only thing I can think of that could of caused this was I added saving and loading using storage containers. I choose the location to save in with:
asyncResult = StorageDevice.BeginShowSelector(playerIndex, null, null);
storageDevice = StorageDevice.EndShowSelector(asyncResult);
asyncResult = storageDevice.BeginOpenContainer("Game1StorageContainer", null, null);
This places the file in: Desktop\Libraries\Documents\SavedGames\Game\Game1StorageContainer\Player1\
This is a vague question but maybe someone has an idea?
:: UPDATE ::
Ok, I've had my friend reinstall the XNA Runtime, same problem.
There are no files in his minidump folder, even with hidden folders shown.
However I have a windows error log here:
Application: My Game.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info:Microsoft.Xna.Framework.GamerServices.GamerServicesNotAvailableException
Stack:
at Microsoft.Xna.Framework.GamerServices.KernelMethods+ProxyProcess..ctor(Microsoft.Xna.Framework.GamerServices.UserPacketBuffer)
at Microsoft.Xna.Framework.GamerServices.KernelMethods.Initialize(Microsoft.Xna.Framework.GamerServices.UserPacketBuffer)
at Microsoft.Xna.Framework.GamerServices.GamerServicesDispatcher.Initialize(System.IServiceProvider)
at Microsoft.Xna.Framework.GamerServices.GamerServicesComponent.Initialize()
at Microsoft.Xna.Framework.Game.Initialize()
at My_Game.Game1.Initialize()
at Microsoft.Xna.Framework.Game.RunGame(Boolean)
at Microsoft.Xna.Framework.Game.Run()
at My_Game.Program.Main(System.String[])
So, It crashed at Game1.Initialize();, which contains:
protected override void Initialize()
{
this.graphics.PreferredBackBufferWidth = 800;
this.graphics.PreferredBackBufferHeight = 600;
this.graphics.IsFullScreen = false;
this.graphics.ApplyChanges();
base.Initialize();
}
So surely it is the base.Initialize();, which I'm guessing is because I've included some new libraries from the framework. So I have no idea what to do, the previous version of my game works fine for him.
Someone have any idea what I can do?
Thanks
Does he have the XNA Runtime installed?
Check the Windows Event Log, it should have a detailed entry for the crash
When an application crashes, a minidump is created. You should be able to load this into visual studio and see where it crashed.
Related
I recently tried to implement Microsoft.AppCenter.Crashes to help track down crashes in my team's Xamarin.Forms app. However, when a crash happens on our iOS project, AppCenter never detects it. I've created the following function for setup and checking, which gets called near the start of our central project's App.xaml.cs App constructor:
private async Task CheckForPreviousCrash()
{
//Setup AppCenter
await Xamarin.Forms.Device.InvokeOnMainThreadAsync(() =>
{
//Keys changed in StackOverflow post for security reasons.
AppCenter.Start("ios=########-####-####-####-############;android=########-####-####-####-############;uwp=########-####-####-####-############", typeof(Crashes));
AppCenter.IsNetworkRequestsAllowed = false; //Prevents sending user data to Microsoft. Required by company
});
//Make sure AppCenter is working
bool isEnabled = await Crashes.IsEnabledAsync();
if (!isEnabled)
{
_logger.LogError("AppCenter could not be started");
}
else
{
//Check for memory leak warnings
bool memoryIssue = await Crashes.HasReceivedMemoryWarningInLastSessionAsync();
if (memoryIssue)
{
_logger.LogError("AppCenter detected a memory warning in the last session");
}
//Check for crash info
bool crashed = await Crashes.HasCrashedInLastSessionAsync();
if (crashed)
{
var report = await Crashes.GetLastSessionCrashReportAsync();
_logger.LogCrashReport(report);
}
//If AppCenter detected no issues in the last session, log an "all clear" message
if (!memoryIssue && !crashed)
{
_logger.LogInformation("AppCenter did not detect a crash in the last session");
}
}
}
I've tested this code using the Crashes.GenerateTestCrash() function, one of the crashes my team is trying to resolve, and a simple recursive function that calls itself forever. When run on iOS, our logs will always show the "AppCenter did not detect a crash in the last session" message, regardless of if a crash occurred. Any help determining what could be causing this would be appreciated.
Notes:
The iOS project is always run without a debugger attached. I'm aware of the rule that crash reports will not be generated if iOS has a debugger attached
This has been seen when built using both Debug and Release mode
This code works as expected on our Android and UWP projects
The iOS project always passes the isEnabled check
This is running AppCenter and AppCenter.Crashes version 4.5.0
This is running on a 7th gen iPad on iOS 15.2.1
EDIT: Extra notes in response to a suggested answer:
The Mac used to build the iOS project is running macOS 11.6.2
Project is built using XCode 13.2.1
The Xamarin Forms project is built in Visual Studio 2019 16.11.7, and sent to the connected mac via Visual Studio's "Pair to Mac" feature
There are no other libraries used for crash reporting (the closest used is Serilog, which should only be handling logging)
We do not use CocoaPods to integrate AppCenter
You can check if you meet the requirements as following shows:
-Your iOS project is set up in Xcode 11 or later on macOS version 10.14.4 or later.
-You're targeting devices running on iOS 9.0 or later.
-You're not using any other library that provides Crash Reporting functionality (only for App Center Crashes).
-If you are using CocoaPods to integrate App Center, you need CocoaPods version 1.10 or later.
App Center SDK Analytics and Crashes are compatible with Mac Catalyst via XCFramework or SwiftPM.
Here are more detail about appcenter crashed on ios https://learn.microsoft.com/en-us/appcenter/sdk/getting-started/ios
I use the library Emgu.CV.World and a set of classes x86 in web solution ASP.NET MVC5. Version EMGU: 3.1.0.2282.
For a while it worked, then I made a copy of the project in the same directory and changed the name of the folder, then began to appear the error:
An exception is thrown at 0x2AF630B1 (cvextern.dll) in iisexpress.exe: 0xC0000005: Access violation reading location 0x00000000.
This same functionality is implemented in the Win Forms application of the same libraries, it works without problems.
But web application all the time breaks down, on this method : CvInvoke.Threshold ().
Used x86, x64 catalogs, copy all the libraries in a separate directory, change the type of application to any CPU , x86 to x64 and nothing.
Tried on other systems (64-bit) is the same. Most interesting is that initially it worked, ie, the error my code is not.
I used, IIS Express 10, vs 2015 community.
I would be grateful for some advice, thanks
The answer was found. The reason for the error has become not noticed during the last refactoring line: imgGray.Dispose();
imageRotate = imgGray.Rotate(-avg, new Gray(255));
}
else
{
imageRotate = imgGray;
}
imgGray.Dispose();
//return imageRotate.Bitmap;
return BlackFilterImage(imageRotate);
}
private static Bitmap BlackFilterImage(Image<Gray, byte> img)
{
UMat resultImg = new UMat();
CvInvoke.Threshold(img, resultImg, 105, 255, ThresholdType.BinaryInv); //Error is here
Unfortunately, the nature of the error to muddle me.
I try to deploy a Click Once Installer but run into a very strange issue:
The installer runs fine but as soon as the application is supposed to start it crashes with the following message
[MyApp] has encountered a problem and needs to close. We are sorry for
the inconvenience.
and no useful information about the cause. As soon as I install Visual Studio Professional 2012 on the same machine, the application starts fine but sometimes behaves very strange (e.g. I have to click to red close button twice to close the application). Funny enough, the problem not always appears, I suspect it has something to do with the order in which I install the .Net Framework/Visual Studio/the Click Once installer.
I am pretty much lost here .....
Btw: The framework targetVersion and supportedRuntime of the Click-Once installer are 4.0 and 4.0.30319 respectively.
Add an UnhandledException handler to your app. This will allow you to see the exception that is causing the crash.
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
static void MyHandler(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = (Exception)e.ExceptionObject;
MessageBox.Show("Unhandled domain exception:\n\n" + ex.Message);
}
Note that the use of MessageBox is only for debugging. A logging system should be used for your release version.
I just got some feedback of some users of our application, they have got issues on windows XP with our application. This application works fine on Windows 7, but not on Windows XP.
One other strange thing: If I build this on a Windows XP workstation(with VS2010), it works on my local workstations, and if I put this build on another XP workstation, it doesn't work anymore.
When running on XP, I just got an error telling me that XXXXX has encountered a problem and needs to close. We are sorry for the inconvenience.
I found in the EventViewer Application's log this stacktrace:
Application: MyApplication.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at System.Windows.Forms.UnsafeNativeMethods+IOleObject.DoVerb(Int32, IntPtr, IOleClientSite, Int32, IntPtr, COMRECT)
at System.Windows.Forms.WebBrowserBase.DoVerb(Int32)
at System.Windows.Forms.WebBrowserBase.TransitionFromRunningToInPlaceActive()
at System.Windows.Forms.WebBrowserBase.TransitionUpTo(AXState)
at System.Windows.Forms.WebBrowserBase.OnParentChanged(System.EventArgs)
at System.Windows.Forms.Control.AssignParent(System.Windows.Forms.Control)
at System.Windows.Forms.Control+ControlCollection.Add(System.Windows.Forms.Control)
at My.NameSpace.Here.Controls.LearningCenterControl.InitializeComponent()
at My.NameSpace.Here.Controls.LearningCenterControl..ctor()
at My.NameSpace.Here.MainForm.InitializeComponent()
at My.NameSpace.Here.MainForm..ctor()
at My.NameSpace.Here.MainForm.get_Instance()
at My.NameSpace.Here.Program.Main(System.String[])
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
This happens on the InitializeComponent of the designer of one of my userControl:
this.m_learingResourceBrowser = new System.Windows.Forms.WebBrowser();
I guess there a Security issue with XP, but what?
I found this:
REM Mark project as DEP Noncompliant
call "$(DevEnvDir)..\..\VC\bin\vcvars32.bat"
call "$(DevEnvDir)..\..\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"
I've put this Post-build event on the exe project, but I didn't saw any improvement
I've also tried to run directly the command with my exe:
editbin.exe /NXCOMPAT:NO YourProgram.exe
Any idea about what could cause this issue?
EDIT
I found this answer which states:
To test if its a DEP issue do this.
Right click on "My Computer" Select "Properties" and "Advanced" Under
"Startup and Recovery, click Settings Now click on "Edit" The notepad
has just begun. Simply replace the line: Code: noexecute optionn by
AlwaysOff Restart your PC to complete the transaction.
And I after this I don't have this error anymore. So my question is: currently I've done the previous operation only on the main exe. Should I do this operation on all dll? Because my project is composed of more than 230 projects, so it would be hard to test everything.
I have the following function that I am attempting to use to determine the length of an MP3 file:
public static string GetMP3DurationBackup(string Filename)
{
string Duration = null;
WMPLib.WindowsMediaPlayer w = new WMPLib.WindowsMediaPlayer();
WMPLib.IWMPMedia m = w.newMedia(Filename);
if (m != null)
{
Duration = m.durationString;
}
w.close();
return Duration;
}
I have run into an issue where I get the following error:
Retrieving the COM class factory for component with CLSID
{6BF52A52-394A-11D3-B153-00C04F79FAA6} failed due to the following
error: 80040154..
when I call the above function from my web application (call below):
string test = MediaUtil.GetMP3DurationBackup(#"C:\Temp\Audio\bad.mp3");
But when I call it from a console application test harness I created (exact same call as above) it works fine. I have set the project that contains the function to target x86 in the Build properties, but that did not fix the issue.
Does anyone know why this would happen? Suggestions on where to start to debug this?
UPDATED FOR BOUNTY:
Ok, I've tried a number of things but I am still getting this error. Among other things I have tried the steps below which I felt were the most promising, but no dice:
Went into my registry and confirmed that the value at:
HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{6BF52A52-394A-11d3-B153-00C04F79FAA6}\InprocServer32
is refering to C:\WINDOWS\SysWOW64\wmp.dll
Opened command prompt,
navigated to C:\WINDOWS\SysWow64, ran: regsvr32.exe wmp.dll
I have created a console app test harness and I am able to reproduce the error if I run the test project in x64. If I switch it to x86 it works fine.
Does anyone have any idea of why the above would not resolve the issue? Suggestions on where to look next?
You say it doesn't work in x64, but you try to register the 32-bit version of wmp.dll (C:\Windows\SysWow64 contains 32-bit assemblies).
Try to register the x64 version of wmp.dll, which is located in C:\Windows\System32 on a 64-bit platform.
If you don't have this file then there probably is no 64bit Windows Media Player available for your platform. But there is a workaround:
Create a 32-bit console application that takes the mp3 filename as command line argument and outputs the duration to stdout using Console.WriteLine, then in the webapp, you call the console application and capture the output like in this example on MSDN
Give this lib a whirl. Its fast and has no special requirements for software to be installed on the machine.
http://naudio.codeplex.com/