Sign in to follow this  
Draycos

Visual Studio project settings - location of created files

Recommended Posts

Draycos    108

I have customised my Visual Studio (2010 express) project settings to separate project, source, temp, debug build, release build files, etc. in to appropriate sub-folders.  The application I have created, when run in either debug or release mode, creates a config file (CreateFile()), but rather than creating that file in the debug or release directory it is created along side the project (.sln, .vxproj) files.  It doesn't cause any problems other than separation of files that I'd like to ultimately ship together.  When running the executables independently the files are created in the correct folder, alongside the exe.  Can anyone advise me which project settings I need to adjust in order to get round this issue? Thanks.

Share this post


Link to post
Share on other sites
SiCrane    11839
Goto Debugging/Working Directory to change the working directory of the executable. Keep in mind, however, that there are ways to launch your an application in normal use that won't set the working directory to the executable directory when deployed, so if you depend on a file being created in the same directory as the executable, you should manually find the directory. Of course, the other part of the problem is that on recent versions of Windows the Program Files directories are locked for writing new files, so you should create application specific data in the ProgramData directory and per user information in the appropriate user AppData directory.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this