I'm writing a .Net WinForms on and constantly switching between DEBUG and RELEASE configurations and have a few files I need either configuration to be able to get to.
What I was thinking to do was to put the files in a common directory in the BIN folder so it would look like this:
MyProject/Bin/CommonFiles
MyProject/Bin/Debug
MyProject/Bin/Release
And I was thinking about accessing the files using something along the lines of:
System.IO.Directory.GetParent(System.IO.Directory.GetCurrentDirectory).FullName
My question is if this is dangerous since, from what I've read, System.IO.Directory.GetCurrentDirectory
might change due to the user selecting a new current directory in, say, an open file dialogue box.
Should I rather use something along the lines of:
System.IO.Directory.GetParent(Environment.CurrentDirectory).FullName
OR is there an even better way to get to the /Bin
folder so I can move from there or a generally accepted way / location to store files the program usually needs to reach and way to reference that more easily (maybe something that's made to work with any kind of app and not just WinForms)?