none
Output file stored in the Debug folder

    Question

  • How come the files that my application processed is stored in the Debug folder? What settings should I change in VS2005? All my parameters are correct, I just can't figure out why the output file is being saved in the Debug folder, which should not be...

    Any help would be appreciated.
    Monday, May 07, 2007 3:14 PM

Answers

  • Post the code that you are using to open/create the output file.  In theory you'll do something along the following:

     

    string strPath = Path.Combine(Environment.GetFolderPath(SpecialFolder.DesktopDirectory), "somefile.txt");

     

    Michael Taylor - 5/8/07

    http://p3net.mvps.org

     

    Tuesday, May 08, 2007 12:33 PM
    Moderator
  • I forgot to put an input and output directory.... My mistake. Smile That's why the processed files are stored in the same directory where the .exe is located, which can be located in the Debug folder.
    Saturday, May 12, 2007 4:02 PM

All replies

  • The default build is always to do a debug version and it is placed in the debug directory instead of release.

     

    To change that look on the standard toobar for the edit box with Debug in it. If you don't have the standard tool bar (open/save/savel all) right click on the menu bar and select Standard toolbar. On that toobar will be a drop down and it will say "Debug", change the drop down and select Release. Now when you build it will be on release mode.

    Monday, May 07, 2007 5:05 PM
    Moderator
  • What files are you talking about?  If you are talking about running your app and it generating files then the files will be stored in the current working directory of your app, which defaults to where the app is.  When you run under the debugger the working directory will be the Debug directory.  However if you move your program somewhere else and run it manually the files will appear in the directory with the EXE and not in the Debug directory.  You can change the working directory for your application using Environment.CurrentDirectory.

     

    If you are talking about the build output then it will go in the directory identified by project settings.  You can change this in the Build tab of the Project settings.

     

    Michael Taylor - 5/7/07

    http://p3net.mvps.org

     

    Monday, May 07, 2007 5:19 PM
    Moderator
  • My problem deals with incorrect placement of files my app processed, specifically, I directed it to save the processed files on the desktop, but when I runned my app in the IDE it saved the files where the .EXE is located, which basically in the Debug folder, which should not be....

    How can it be redirected to the proper directory?
    Tuesday, May 08, 2007 12:07 AM
  • I've provided a directory  to save the files. The problem is, files are not stored in the directory I've provided when running my app in the IDE, instead they go directly to the Debug folder, where the .EXE is loacated...

    If I provided the Desktop to be the directory to save my files, there aren't any files in the Desktop after my app procesed them. But they can be located in the Debug folder. How can I correct this problem?
    Tuesday, May 08, 2007 12:13 AM
  • Post the code that you are using to open/create the output file.  In theory you'll do something along the following:

     

    string strPath = Path.Combine(Environment.GetFolderPath(SpecialFolder.DesktopDirectory), "somefile.txt");

     

    Michael Taylor - 5/8/07

    http://p3net.mvps.org

     

    Tuesday, May 08, 2007 12:33 PM
    Moderator
  • I already fixed the problem... Thanks for the replies anyway....

    More power!
    Wednesday, May 09, 2007 3:09 AM
  • Hi, K3V1n

    Can you post your solution here, so that it may benefit other members in the community.

    Thanks

    Wednesday, May 09, 2007 4:19 AM
  • I forgot to put an input and output directory.... My mistake. Smile That's why the processed files are stored in the same directory where the .exe is located, which can be located in the Debug folder.
    Saturday, May 12, 2007 4:02 PM