0

I have two Windows Application projects and i need to use Application.StartupPath() to read from some files. Build output [in Project Properties] for both projects is set to bin\Release. Still, for Project A the executable is created in bin\Debug so Application.StartupPath() points to bin\Debug. But every time i compile Project B, the executable is created in bin\Release [so Application.StartupPath() poinst to bin\Release], but there is another executable in bin\Debug that at some compiles gets updated. It seems to be a random behaviour. Or am I missing another setting? I need to be able to know exactly where my output will be created.

thank you
p.s. That's how Project B behaves on a vista machine. But on an XP machine Application.StartupPath() sometimes points to bin\Debug, and other times to bin\Release. :-??

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by sknake
0

It sounds like your solutions file isn't being saved by the IDE. What you could do for development is something like:

public static string GetFileName()
    {
#if (DEBUG1)
      return @"C:\blah.txt"; //dont need to use App.Path()
#else
      return System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "blah.txt");
#endif
    }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.