How can I run the runnig path to my application from app.xaml.cs itself?
You may try
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) AppDomain.CurrentDomain.BaseDirectory
and / or
Environment.CurrentDirectory
You can simply use the System.Environment.GetCommandLineArgs property to get the command line that starts the application. Parse this using the System.IO.Path methods to extract only the executable file name or full path.
var exeName = System.IO.Path.GetFileName( System.Environment.GetCommandLineArgs()[0]); MessageBox.Show("This exe filename is " + exeName);
This always works:
System.Windows.Forms.Application.StartupPath
Source: https://habr.com/ru/post/1717116/More articles:Why is an OperationContract attribute required in a WCF service? - c #Self-referential enum attributes in C # dynamic assembly - enumsCustom Latex Application - latexHow can I use T4 templates with MonoDevelop 2.2 on OSX - monoКак настроить jaxb-поколение? - javaHow to create a mutable array of CGImageRefs? - arraysHow to round to a certain decimal precision? - mathHow to check numerical overflow and overflow conditions in Perl? - numbersIs it possible to disable individual list items in WPF? - .netCreate real-time audio applications with software synthesizers - latencyAll Articles