I have code that tests which folder a project is running from to determine if it is the testing version or production version. I know there is a way to do this with the difference between debug version and released (which I want to do in the future but I don't know how yet). So for now, this is a workaround to get me what I need. This code works correctly when I run from Visual Studio but not when my scheduled task runs the compiled version.
string projectPath = System.IO.Directory.GetCurrentDirectory();
var TestVersion = true;
if (projectPath == @"H:\Automation\RefreshData\RefreshData\bin\Debug" || projectPath == @"\\atlelz1fs03.atalanta.local\USERS\Automation\RefreshData\RefreshData\bin\Debug" || projectPath == @"H:\Automation\RefreshData" || projectPath == @"\\atlelz1fs03.atalanta.local\USERS\Automation\RefreshData")
{
TestVersion = false;
}
Which folder should I be looking at for the compiled version? or is there a better way for me to determine this?