The error messages says it can not find the specified directory location. However the name of the second progam that is called is from an old location where the second program used to be at. However that is not the location where I am speficying that the second program should be executed from.
I have no idea how the first program calls the second wrong with the wrong directory path. Do I need to keep the path of the second console application static?
From the error message, the path that you supplied to Process to start doesn't exist. Whatever you think it tried to launch is not what's important here. It's what the code thought when it tried to launch this second process.
You have to step through the code in the debugger or instrument the code to log what it's doing and what key variable values are to a file.
You mentioned the followed:
Probably because of the following
1. You are not doing error checking when you use Process
2. You are making assumptions about the output of the second app which are not true.
I have a try catch block in the code that calls the second application. Is that not enough code. If not, what other error checking do you suggest I use?
You mentioned, " You are making assumptions about the output of the second app which are not true.". Can you tell me what I can do to make certain the second assumption is not true. What do you suggest I do so I do not make any assumptions?
I have a try catch block in the code that calls the second application.
Process represents a distinct operating system application. There is no way for exceptions to propogate across the process boundary.
However Process methods do have return values. Which you are ignoring.
Can you tell me what I can do to make certain the second assumption is not true
Insure that you can read both zero bytes and a very large number of bytes from stdout and stderr. And if you are not otherwise processing those for specific output then collect it somewhere so you can inspect it for errors and unexpected output.
Whenever you have a question regarding base framework things like this, you should first put that into google and then pick the link to the MSDN documentation. In most cases, this will be one of the first 3 links and is the best documentation to start learning from. Cheers. Delegates[^]
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
Voted 1 for (i) wrong forum (this has nothing to do with C#) and (ii) 'gimme codez' – we are not here to 'provide you solution' to a problem, that is what Google is for; CP is for asking specific questions when you are having a problem with an isolated aspect of your code.
i have write 5 diff words from 5 diff language into this string .
Looks to me like you have 5 different phrases, not words, and that each phrase is separate by a comma.
So first step is to break it into those parts.
After that you no longer have a problem of 5 different languages together. Instead you have a problem of identify a language (one language) given a string with one language. And then doing that five times.