In a C# 2008 application, I am having the program execute another C# 2008 application. I am getting the error message, "The system cannot find the file specified".
Thus the second program is not located.
To solve this problem, where should the executable be located for the first program to find it?
In the deployment package, do I need to place the executable in the same directory path as where the main program is located at?
Loading
VulpesPosted Oct 11, 2012, 1:43 PM
dcPosted Oct 11, 2012, 11:21 AM
1. The statement you listed above, how would I change it to find a specific location of the executable?
2. Should I just change the location of the second executable to be just the name of the executable alone without a directory path assigned to it? That way by default, the program will know where the second program is located at?
3. Should I change the path of the second executable to be a static variable so that it does not change?
4. Should the second executable be setup as a reference in the visual studio 2010 ide where the first progam is executed from? Can you tell me the reason why or why not for adding the second progtram as a reference to the first program?
VulpesPosted Oct 11, 2012, 6:53 AM
dcPosted Oct 10, 2012, 9:48 PM
I have the following additional questions:
1. Why is it less hassle to put the executable of the second application in the same directory as the first program? Does the .net framework assume some of default directory if no directory is specified? If Microsoft assumes a default directory can you tell me where the default directory is locatecd at?
2. When my company deployed my C# 2008 and 2010 applications to a test server, one of the applications did not use the configuation set for where the executable was suppose to be at? Our network administrator found where the first program thinks the second executable was at.
Thus I am trying to determine why one of the programs did not take the setting it was given.
The location the first program was looking at was at:
c:/server name/share directory name/test/app1.exe.
The only way I can think this location was picked since on a few tries, the location of the executable as was at:
//server name/share directory name/test/app1.exe
Is this accidently? Should I have the network administrator reboot the test server to see if the c:/server name/share directory name/test/app1.exe. location request goes away?
3. To fix this problem permanently, should I have the executable value of the second location in a static variable name? What do you suggest?
VulpesPosted Oct 10, 2012, 12:56 PM
You'll have least hassle that way :)