c# - Why does relative path of project files auto-resolve to c:\windows while executing the build in release mode? -
so, have completed c# console application using microsoft visual studio 2012. have local file within project folder. within code, have performed log writing operation assigning relative path of file string variable. file created during first build/run , appended information during further runs.
string rpath = "..\\logfile2.txt";
i built project in debug mode , ran it. during run rpath correctly identified as
c:\project_app_folder\bin\logfile2.txt
however, while building project in release mode , scheduling .exe file run @ particular time in windows task scheduler, run-time error saying
could not find part of path 'c:\local\pic'.
how resolve this? want temporary folders or text files created during run time part of project folder/package?
please note , cannot put absolute paths code have packaged , sent user , user may chose store program in location he/she sees fit.
this issue not because of release mode, when scheduler invokes program working directory different @damien_the_unbeliever said. can use "start in" option when specify action, release directory.
the "start in" make sure if have relative paths in task run, understands directory use.
Comments
Post a Comment