vb.net - Getting Application.CommonAppDataPath and UserAppDataPath in ApplicationEvents Startup -


i set default location files on application startup, in applicationevents' myapplication_startup sub can't seem application.commonappdatapath , application.userappdatapath variables.

is there way around this? without hard coding of course.

application in main part of project (in own forms, classes, etc.) refers system.windows.forms.application class. however under myapplication class (or more my namespace) refers <your namespace>.my.application (which same my.application).

this happens because framework's classes , objects shadowed project's local objects. in case framework's application class shadowed project's my.application property.

you need add namespace in beginning:

system.windows.forms.application.commonappdatapath system.windows.forms.application.userappdatapath 

Comments