Check this path:
string f = Path.Combine( Path.GetDirectoryName( Assembly.GetEntryAssembly( ).Location), "appsettings.json" );
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear community,
I have this issue: I deployed a console application (C# - Visual Studio - Unix Executable File). As you will see in the following screenshots, the issue is that running by double-click or using the full path doesn't allow the Terminal to recognize the Folder the file is in. Still, if I go to the folder first and then I run the application it works without issues.
I used these lines for seeing the console information. The result in Images 4 and 5:
var path = Directory.GetCurrentDirectory();
Console.WriteLine(path);
So my question is: what do I need to do in the code for forcing the MacOS terminal to recognize the current PATH where the executable is? I need to read the appsettings.json, and a masterdata.sv file from the directory.
[Image 1]: double-clicking it.
[Image 2]: using the full file path.
[Image 3]: going inside the folder and running the Unix Executable File
[Image 4]: running Directory command debugging in the VS for MAC:
[Image 5]: running by double-clicking the executable in the same Debug folder:
Thanks in advance,
Juan
Check this path:
string f = Path.Combine( Path.GetDirectoryName( Assembly.GetEntryAssembly( ).Location), "appsettings.json" );