none
Create folder in bin/Debug

    Question

  • Whenever I create files in VB.net, the results go by default in the bin/Debug folder. I would like them to go in bin/Debug/Test without having to write the actual location, since the project folder may change from user to user (ie they dont place their project in the same folder I do). Is there an easy way to do that?

    Best regards
    Tuesday, November 24, 2009 6:04 AM

Answers

  • Use Application.StartupPath when referencing the directory of your application and you shouldn't have a problem.  If you would like them to go in bin/Test always, open the properties for your project, go to the "Compile" tab and in the Output Directory textbox - change the locallized path into bin/Test or whatever you need. 

    The full application path (using the shared member mentioned earlier) will still be accurate no matter where they installed to.  But you will have to specify the bin/Test yourself.
    Tuesday, November 24, 2009 6:53 AM

All replies

  • Use Application.StartupPath when referencing the directory of your application and you shouldn't have a problem.  If you would like them to go in bin/Test always, open the properties for your project, go to the "Compile" tab and in the Output Directory textbox - change the locallized path into bin/Test or whatever you need. 

    The full application path (using the shared member mentioned earlier) will still be accurate no matter where they installed to.  But you will have to specify the bin/Test yourself.
    Tuesday, November 24, 2009 6:53 AM
  • Hey syntaxeater, thanks for the useful information.
    However, I would like to do this just by using code without setting the bin/Test through the project properties, is that possible?
    Tuesday, November 24, 2009 9:37 AM
  • any reason why u want to do this in your code ??? your code is going to work after it gets executed, so no way that your application  gets into other folder at compile time, u need to do the settings at project properties only...

    let me know if u have any doubts...

    hope this helped u...


    Narayanan Dayalan - Zeetaa Business Solutions ------- Please "Mark As Answer", if my answer works well with ur Query
    Tuesday, November 24, 2009 9:44 AM
  • Sure.  During runtime, use System.IO.Directory.CreateDirectory(Application.StartupPath & "\Test").  All depends on when you want to create it.
    Tuesday, November 24, 2009 10:00 AM
  • Be aware that the standard Application Folder (in most language versions Program Files) is closed by Vista and W7


    Success
    Cor
    Tuesday, November 24, 2009 11:32 AM
  • What do you mean by closed?
    Tuesday, November 24, 2009 11:35 AM
  • I'm trying to set a startuppath to be in where the application is executing (in my case bin/debug) to /test, so bin/debug/test, but the filedialog menu just goes until bin/debug. the 'test' folder already exists by the way..

    Dim appPath As String = Application.StartupPath
    Dim startPath As String = appPath & "/Test"
    OpenFileDialog1.Title = "Testing"
    OpenFileDialog1.FileName = ""
    OpenFileDialog1.Filter = "ALL (*.*)|*.*"
    OpenFileDialog1.FilterIndex = 1
    OpenFileDialog1.InitialDirectory = startPath
    Any ideas?
    Tuesday, December 15, 2009 12:06 PM
  • Nevermind, working now.
    Tuesday, December 15, 2009 12:10 PM