System.Environment.CurrentDirectory() simply returns the current directory
(which can change during execution or by starting the program with a
shortcut with a different "Start In" setting.
According to the Help (look under "App Object Changes"), the official
replacement for App.Path is:
System.Reflection.Assembly.GetExecutingAssembly.Lo cation
Beware, because this returns the filename of the Exe or dll as well - you'll
need to strip this off to get the directory. Also if the code is in a dll
that is in a different directory than your current application, it will
return that path instead.
If you want to get the path of the main executable that started the
application, use
System.Reflection.Assembly.GetEntryAssembly.Locati on
Instead
Hope this helps,
Trev.
"Alexandre Moura" <am****@online.microsoft.com> wrote in message
news:9L**************@cpmsftngxa07.phx.gbl...
Use System.Environment.CurrentDirectory:
'on a console app:
Module Module1
Sub Main()
Console.WriteLine(System.Environment.CurrentDirect ory())
End Sub
End Module