I've made a console app that takes as input a path to a file. One of the ways the app checks the validity is as follows:
if
(!File.Exists(sourcePath)) {
Console.Out.WriteLine(sourcePath + " is not a valid source path");
return;
}
sourcePath value here is something like "C:\temp\sourceFile.moo"
This works fine for running the app locally(MachineA). However, if I place this app on my network (\\MachineB\myApp.exe) and then try running it from machineA again with the same exact parameter input and with the source file path unchanged, it breaks out at that part of the code.
What am I missing? It seems to me as if the code were being run entirely on machineB (which obviously is missing the sourceFile.moo) even though MachineA is calling it. Is this the case? If so, what could I do to explicitly tell it to look for the file on the machine that is calling the app, not the machine that the app is saved on.
My thanks to anyone with suggestions.