I'm using Visual Studio 2005 to build web apps.
When I create a file system web.app, references to a given file (e.g., "~/APP_DATA/Datafile.xml") can't seem to find it, but when I build and deploy it, it does.
I'm guessing this has something to do with the additional directory levels ("Bin\Debug" or "Bin\Release") that are added to the project when testing it on the Virtual Server. So I added a bunch of code along the lines of:
dim f as new file
if file.exists(Directory.CurrentDirectory & "APP_DATA/Datafile.xml") then
f=Directory.CurrentDirectory & "APP_DATA/Datafile.xml")
f=Directory.CurrentDirectory & "../../APP_DATA/Datafile.xml")
There's got to be a better way. In fact, I don't even know why this works?...