Link to home
Start Free TrialLog in
Avatar of Skale
Skale

asked on

Environment.CurrentDirectory changes after publishing the application

I'm using my application in Release folder output and i create several folders in Release folder where my running exe belongs.

and i have lots of Path directions like below;

 Dim dbDir As String = Path.Combine(Environment.CurrentDirectory, My.Settings.str__data_dir, My.Settings.str__data_db)

Open in new window


all my Environment.CurrentDirectory returns different location after i published it and open there.

User generated image
Is there a way to define these directories? Any help would be grateful.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of hilltop
hilltop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Skale
Skale

ASKER

Thank you hilltop in that case i have to define all .CurrentDirectory paths to exact path in that case.
Nothing would prevent you from using the Environment.CurrentDirectory; value in your setup. Even the free NSIS setup compiler would support it. You can always copy whats needed on setup or other..