Connecting Tech Pros Worldwide Forums | Help | Site Map

VB.Net - Application.StartupPath "Application" not declared error

Newbie
 
Join Date: Jul 2008
Posts: 10
#1: Sep 4 '08
I'm making a program that at some point needed to know what the path to it's own directory was, so i quickly made a side project just to test how this works ending up with the use of application.startuppath.
Everything was working fine so i went back to the original project and tried to implement that solution, however, whenever i try to type that command i get an error message saying that Application is not declared.
I didnt load any dll at all on the project that recognised the command, so i'm a bit stumped as to what the problem is.
Any help is appreciated.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,158
#2: Sep 4 '08

re: VB.Net - Application.StartupPath "Application" not declared error


Do you have the Windows.Forms namespace added?
Newbie
 
Join Date: Jul 2008
Posts: 10
#3: Sep 4 '08

re: VB.Net - Application.StartupPath "Application" not declared error


Thanks! It worked, although i dont understand why i didnt have to do it on the side project. Anyway, thanks again.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,158
#4: Sep 4 '08

re: VB.Net - Application.StartupPath "Application" not declared error


Your side project was probably a windows forms application, and it was already included.
Reply