I'm trying to get the Base path of my VB Project dynamically since the path that the project is run from will change.
Let's say that the VB Project file is in C:\MyVBProjects\May2016\MyProject\MyApp.vbproj
I tried using Application.ExecutablePath, Assembly.GetExecutingAssembly().Location and Application.StartupPath
The above three return C:\MyVBProjects\May2016\MyProject\bin\Debug\
I also tried using the following code:
Curr = Directory.GetCurrentDirectory()
Root = Directory.GetRootDirectory(Curr)
This returns just C:\
Is there anyway I can get it to say C:\MyVBProjects\May2016\MyProject\
?
I'm currently using Visual Basic 2012 on Windows 7.