This works on on a Mac:
string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
We have a MacOS App built with Xamarin and we are implementing a Cmd Line Mode to use the program.
Unfortunately we don't have the correct working directory
We can call the App via
cd ~/Desktop
/Applications/MyApp.app/Contents/MacOS/MyApp -args1 -arg2
So if there is arguments I don't call the UI.
However Environment.CurrentDirectory is always set to NSBundle location and not to the Desktop, Is there anyway to find the current working directory from a MacOS App, that in this case would be the desktop?
This works on on a Mac:
string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;