Application run on my machine, and give strange error on others
Solution 1
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.
Solution 2
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
Mustafa Magdy
Updated on June 04, 2022Comments
-
Mustafa Magdy almost 2 years
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 ??
-
Mustafa Magdy over 12 yearsyes, I tried this already, but the application don't even start up in the processes :(
-
Mustafa Magdy over 12 yearsthe target machines have .net version and the application was working days ago .
-
Yohann Canu over 12 yearsIt happens to me once because of a windows update... I then installed the Visual C++ Redistributable.
-
Daria Dragomir over 12 yearsthen the problem isn't with your application, it's with the client environments having the required .NET framework files installed
-
Mustafa Magdy about 11 yearsthe problem has been solved, but i don't remember exact cause for that, but I re-install the dontnet framework 4.x and it works fine :)
-
Chris - Haddox Technologies about 11 yearsAwesome. I'm glad you got that figured out. I added this in hopes it would help someone else later down the road.