Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have console application running (Third party not written by me) which crashes everytime the server have problems (Out of my control also). I was trying & failing to write a application which monitors the Console Application & if non responsive kill & restart. The kill & restart is the easy part but when I try to monitor the program it says the process is responding Ok, but Windows & is stating the program has stopped running

VB
Dim myProcesses() As Process
                   myProcesses = System.Diagnostics.Process.GetProcessesByName("ConsoleApplication1")
                   ' Tests the Responding property for a True return value.
                   If myProcesses(0).Responding Then
                       lbl_Status.Text = "Process is OK"
                   Else
                       ' Forces the process to close if the Responding value is False.
                       myProcesses(0).Kill()
                       System.Diagnostics.Process.Start(txt_Process.Text)
                       lbl_Status.Text = "Process is Crashed"
                   End If


I am totally lost?

Not ideal but any ideal or directions?
Posted
Updated 19-Jun-15 7:33am
v2
Comments
Sergey Alexandrovich Kryukov 15-Jun-15 15:18pm    
Yes, I would say so. You are lost but having the task which may be should not be solved at all. Is that 3rd-party application so valuable, so you would need to do this abuse? In my opinion, if it was really valuable, it would not crash. :-) Is it a .NET console application or something else?
—SA
Knight school 16-Jun-15 15:01pm    
Thanks for you comments,
Its a .net console application written for our company by an outside programmer (Before my time) & they are not willing to supply to source code so I can fix this oversight (possibly a try catch with a simple timer). The application collect data from there software to pass it to another piece of software (Some database & some app data). To re-write this would be difficult & time consuming & they would not be willing to pass all the info over. So this would be simpler to restart the crashed software but is not showing as non responsive. I am assuming that Windows 7 is see thing a bit differently. I have little or no luck getting the server boys to look at the server issue (Software & process to small to spend their time on).

We could pay the original programmer even more money to revisit what he did not do well last time. but good money to bad is in my opinion a good thing.
virusstorm 19-Jun-15 13:48pm    
There may be another option. If this is a .NET application and you are unable to get the source code, for what ever reason, then you could try to decompile it. There are many tools out there that allow you to this.

ILSpy (open source)
Reflector (commercial)
dotPeek (freeware)
JustDecompile (freeware)

These tools could help you recover the source code (or a functional equivalent) that you could use to update the application and stabilize it.
Sergey Alexandrovich Kryukov 19-Jun-15 14:35pm    
Good idea, if only it is applicable. I credited you for this comment in my answer. I decided to post a formal answer, because I'm afraid that the inquirer has no clue how dangerous the situation is. The problem should be fixed in a radical way, not the way this member may think could be used.
—SA
Knight school 20-Jun-15 13:54pm    
I see the point (At last). I have never tried to decompile a file before but I will give it a go on Monday. Thanks for the new direction.

1 solution

Ordering software development without getting the source code can be called "project suicide". Allowing such things to happen is nearly the crime against the ordering company. Continuing to use the module without the source code endangers the product. If you not reverse engineer it and don't have any substitute, consider your whole project failed. No matter how much it costs, you should either reverse-engineer or develop this module from scratch, to have the source code of the software.

If you continue using this product without source code, you only put your main product close to collapse. You should not solve the problem you have posted, you should fix the whole thing and create and obtain the source code. Please see the comment to the question by virusstorm.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900