In my code I fail
if (!File.Exists(_configurationFileName)) {...}
In a direct window, I made a call Directory.GetCurrentDirectory()and pointed me to the work folder , and not to the code folder , which I would expect.
Directory.GetCurrentDirectory()
"C:\\SfDevCluster\\Data\\_App\\_Node_0\\My.Application.Type_App2\\work"
Thus, my configuration file, which is located next to the executable file, of course, was not found.
Now I wonder what the solution is.
Since I also want to continue working with the console application, I do not want to implement any kind of "hosting, if you change the current directory, ...".
Any recommendations? What about my .exe.config files (if I had, how would they be found)?
What is the reason that Service Fabric is setting the current directory to "work"? Is this some kind of security mechanism?