I am using c#, VS 2005.
I have one solution with two projects.
Project1 needs to startup project2 after some checks.
How do I get the executable path of Project2 from within Project1?
I need a solution for both debug and live mode.
thanks,
KS
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The EXE for the 2nd project needs to have a predictable location, relative from the 1st EXE. Getting the absolute path for the folder that contains your first EXE is easy:
Then append the relative path of your 2nd EXE. Keeping it in the same directory as the 1st is strong recommended:
The easiest way to get this to work well in the IDE as well as on the target machine is to let the IDE copy project2.exe. Right-click project1, Add Reference, Projects tab, select Project2. The Copy Local property of the reference will be True so that project2.exe ends up in the same directory as project1.exe