One method:
System.AppDomain.CurrentDomain.BaseDirectory
Another way to do it would be:
System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName)
More Related Contents:
- How to get ToolTip from WPF Data Grid Column Header (DataGridTemplateColumn) in code?
- MVVM: Tutorial from start to finish?
- Issue with DependencyProperty binding
- Good or bad practice for Dialogs in wpf with MVVM?
- WPF global exception handler [duplicate]
- Storing WPF Image Resources
- WPF CreateBitmapSourceFromHBitmap() memory leak
- No output to console from a WPF application?
- Change desktop wallpaper using code in .NET
- Bring a window to the front in WPF
- C# – approach for saving user settings in a WPF application?
- .NET Memory issues loading ~40 images, memory not reclaimed, potentially due to LOH fragmentation
- How do I exit a WPF application programmatically?
- How do I restart a WPF application? [duplicate]
- The calling thread cannot access this object because a different thread owns it [duplicate]
- Updating an ObservableCollection in a separate thread
- How to programmatically click a button in WPF?
- Software rendering mode – WPF
- Single click edit in WPF DataGrid
- BitmapImage to byte[]
- Print FixedDocument/XPS to PDF without showing file save dialog
- Screen Resolution Problem In WPF?
- How can I get the Position of textbox that has been pressed?
- Set Item Focus in ListView WPF
- How do I compute the non-client window size in WPF?
- Accessing static fields in XAML
- How do I keep aspect ratio on scalable, scrollable content in WPF?
- Storyboards can’t find ControlTemplate elements
- Autocomplete combobox for WPF
- How to follow the end of a text in a TextBox with no NoWrap?