Skale
asked on
How to create default folder structure with publish of application in vb.net
I'm working on application which requires different type of inputs and i'm storing that required files and folder in my "Release" output folder.
Also i'm using that paths in mycodes like below format;
In fact when i'm running in "Release" , Environment.CurrentDirecto ry is D:\TestCode but after i published the code all my paths is changed to RoamingData folder as you can see on error message when my application didn't found the path.
After that i asked a question and realize i shouldn't built my path structure to Environment.CurrentDirecto ry.
So now i wonder when we're installing a commerical software that comes with several folder structure(like below image), what's the approach that programs use this directories.
I'm asking this because i'll be creating different folder structures and i want to access them in all cases.
Any help would be grateful.
Also i'm using that paths in mycodes like below format;
Dim dbDir As String = Path.Combine(Environment.CurrentDirectory, My.Settings.str__data_dir, My.Settings.str__data_db)
In fact when i'm running in "Release" , Environment.CurrentDirecto
After that i asked a question and realize i shouldn't built my path structure to Environment.CurrentDirecto
So now i wonder when we're installing a commerical software that comes with several folder structure(like below image), what's the approach that programs use this directories.
I'm asking this because i'll be creating different folder structures and i want to access them in all cases.
Any help would be grateful.
ASKER
Hi Chimnay,
It's published as ClickOnce application. Is that causing that ?
It's published as ClickOnce application. Is that causing that ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Using current working directory is a right approach. In your case things might not have worked as it expects files to be deployed along with the folder.
And Environment.CurrentDirecto
If you are not setting it manually or by mistake, and if you start your app from D:\TestCode, it should look for the database under D:\TestCode only.
Regards,
Chinmay.