|
Sounds like the first application is doing exactly what you want it to do. You should be investigating why the second application never exits.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
I have to agree with Wes. What is the problem? It is doing exactly what you are telling it to do. Do you want it to wait or not? Do you want to add a timeout to the process?
|
|
|
|
|
I probably should add a timeout to the process. How do you do that?
|
|
|
|
|
Before you do something like this, do you know why it's hanging?
|
|
|
|
|
I do not know why the application is hanging.
Maybe the "second console" application never stops running? Is there a way that I can tell if the "second console" application ever stops running? If so, how can I tell when the "second console" application has finished executing?
Basically the second console application calls a web service to obtain information. The "second" console application has a proxy in it to communicate with the web service.
There is an 'xsd' file that communicates with the web services via xml. Do proxies always keep running?
|
|
|
|
|
You can check if the process exists, that's one way.
|
|
|
|
|
You should forget about using Process.Start for the moment and make sure that you understand how the second application behaves when run manually in a command window.
Hopefully after typing in the correct command line, the application will run and then exit. If the running application requires user interaction, e.g. "Press a key to exit", then it may be a poor candidate for automation via Process.Start.
If the manual run is ok can you post the code used to initialise the Process object.
Alan.
|
|
|
|
|
I am going to run the application manually and let you know what I find out.
When I run the application from the console application, here is the code to get the application running:
private static String strConsoleAppLocation = "C:\\temp\\Eclient.exe";
private static String strEncryptedValue = "encrypt value"
private static String strWebServiceurl = "https://test1/testWebService";
Process_Arguments = null;
Process eProcess1 = new Process();
eProcess1.StartInfo.FileName = strConsoleAppLocation;
Process_Arguments = strEncryptedValue + " " + strWebServiceurl + " 10 " + SPkgID;
eProcess1.StartInfo.Arguments = Process_Arguments;
eProcess1.Start();
|
|
|
|
|
I want to make the following comments:
1. When I stepped through the code using a visual studio.net 2008 debugger, the application did finish executing when the main procedure finished executing. Basically there was no where for me to step through the code again.
However the debugger was still active and ready to continue debugging.
Does this the application is still executing?
2. As far as I can tell, the application runs fine from the dos window. It does not ask me to enter any information. Does that mean it has finished executing?
|
|
|
|
|
Some apps may be behave differently when run "normally" or from a batch or with pipes and redirection.
You might want to try running it via my ProcessCommunicator[^] to see how it actually behaves when executed in a Process.
|
|
|
|
|
I would like to call psexec or a native class inside of a simple GUI, so that I can query racadm.exe (a dell utility) on a remote server and get current drac information for that particular box.
Is there a wrapper available for this?
Thanks!
|
|
|
|
|
Does the last reply on this[^] page help?
/ravi
|
|
|
|
|
Hi,
I'm actually looking for a wrapper so that the code is native, instead of using standard in/out, but I might have to go that way.
Something like this except I cannot get that project to open in vs2008?
Push and Run .NET Code on Remote Machine[^]
|
|
|
|
|
Hi
How should be used these objects,
- do I have to create an object every time in an using block
(creating connection every time I need a query)
or
- I can create the object globally and reused for every query I need? Will the server close this connection if it is idle, and I will have an exception when trying to reuse it?
Should be this object(context) thread safe?
modified 13-Sep-12 10:47am.
|
|
|
|
|
George Nistor wrote: How should be used these objects,
Which objects?
George Nistor wrote: Will the server close this connection
Are you talking about an SqlConnection? It will keep open a while, but I close the connection after the operations are done. I open it for the next time again.
George Nistor wrote: Should be this object(context) thread safe?
They are not thread-safe automatically. You have to use delegates to call them from different threads if you are talking about an sqlconnection.
It would be more helpful if you say what you are talking about as concrete as possible. Otherwise I may have answered your questions but I think I don't have...
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
yes, I talk about SQL connection.
What do you mean by using delegates. To create some functions where I open the connection with using ?
ans possibly pass some delegates with the functionality I require?
|
|
|
|
|
George Nistor wrote: What do you mean by using delegates. To create some functions where I open the connection with using ?
Sorry, I didn't told the truth, I mixed it up with something completely different. The SqlConnection is threadsave. Therefore no delegates aren't needed. I used some other communication at the same time and this wasn't threadsafe, so delegates were needed.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Hi All,
I Develop an application with main form (MDI Form) and all child forms opened in the same form, but my problem is when open the application the windows task bar doesn't show until i minimize or close the application.
please help me if you can who to show the windows task bar in the same time when my application is opened.
Thanks.
|
|
|
|
|
Go to the MDI-Form and take a look to the properties. Is the property "ShowInTaskbar" set to true? If not set it to true. That's the normal state, but it seems it's missing for your form.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Hi,
The property "ShowInTaskbar" is true but still the windows task bar disappeared
Thanks
|
|
|
|
|
Ok. The Windows is not shown in the taskbar, you say. If you create a new Project with a normal form, is that shown on taskbar?
If it is shown, the problem might be your project. Create a new one and copy the files to the new folder, include them into the new project.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Just to be clear about this: the ShowInTaskbar for the main form, right? MDI children will never appear in the taskbar.
|
|
|
|
|
|
Albarhami wrote: Try to handle it with dock property
The dock property has nothing to do with the task bar. It just handles if a control is docked on one side of it's parent.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
If you have a Windows Form application here, it means one of two things - one, the taskbar is set to autohide, or two, you have code in the application that's designed to run the application full screen.
|
|
|
|