Application.StartupPath
I am using WPF C# and I am trying to use Application.StartupPath but as u can see I can not use this method, why's that?
6 Replies
put your mouse over the red squiggly, it tells you
it says there's no definition
I replaced it with
Hope that works
Application.StartupPath is part of the Windows Forms library
ooh interesting
what is the best alternative in WPF?
you can import System.Windows.Forms and use Application.StartupPath if you want
the other popular suggestion seems to be AppDomain.CurrentDomain.BaseDirectory
Process.GetCurrentProcess().MainModule.FileName
is another suggestion, which includes the name of the currently running exeI dont need that since I am building a C# Compiler
It builds an another executable in the base dir