Where did my file go?

time to read 1 min | 90 words

What happen if you are doing something like this in ASP.Net:

File.WriteAllText("fun.txt", "Foo Fum");

On my machine, it goes to: c:\windows\system32\inetsrv\fun.txt

Remember that the current directory in ASP.Net is wherever the server process has decided it should be, if you want the directory that your application is on, use AppDomain.Current.BaseDirectory for it.