Application run on my machine, and give strange error on others

2

this application runs smoothly on my machine, but when trying to run on others it doesn't appear at all.

after searching the logs i found this

Source = Application Error

Faulting application name: Diamonds 2.1.exe, version: 2.1.1.23755, time stamp: 0x4e426777
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0
Exception code: 0xe0434352
Fault offset: 0x000000000000aa7d
Faulting process id: 0x1ad0
Faulting application start time: 0x01cc574ef6707ed5
Faulting application path: C:\Users\Administrator.DEVELOPER\Desktop\EXE\Diamonds 2.1.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 34498134-c342-11e0-8d91-6cf049ab4bd2

Source .NET ERROR

Application: Diamonds 2.1.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException
Stack:
   at Diamonds.Program.Main(System.String[])

the application was running normally, i didn't do any new modifications other than splitting some function to a new dll library.

Any Ideas ??

.net
.net-4.0
windows-applications
asked on Stack Overflow Aug 10, 2011 by Mustafa Magdy • edited Aug 10, 2011 by borrible

3 Answers

2

I just encountered this issue in a Windows form App I created. Apparently there is a plethora of issues that can cause this. In my case you could open the Task Manager, click the application, see it open in the task manager, and immediately close. The only way to see what the issue was, was to look at the event viewer and find the error.

The first is dependencies. Like mentioned above, ensure all required .dlls are included and that you have the required framework(s) installed.

Second KERNELBASE.dll can become corrupted. To ensure that is not the case you can run the System File checker. Instructions can be found here: http://support.microsoft.com/kb/929833

Third, is my case. I had a method running in the constructor of Program.cs which is the first thing instantiated when you start a windows form app. I had a bug in code that was causing an exception before any exception handling was created. To fix the problem I moved the code to a point after I create an unhandled exception method as such:

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

in my forms constructor. Now the program would start and actually throw an error. I then just had to fix the bug in my code.

I hope this can help you or anyone else out there.

1

If the other machine do not have Microsoft .NET Framework 4 install it http://www.microsoft.com/download/en/details.aspx?id=17718 . if it depends on c++ assembly you should also check out Visual C++ Redistributable http://www.microsoft.com/download/en/details.aspx?id=5555

answered on Stack Overflow Aug 10, 2011 by Yohann Canu
0

If there's a problem with the client environment (version of .NET, OS, etc.) you can confirm that by changing your application to do nothing but end, or maybe show a 'hello, client' messagebox.

answered on Stack Overflow Aug 10, 2011 by Beth

User contributions licensed under CC BY-SA 3.0