views:

247

answers:

3

I've been warned by several people not to store temporary files in the Temporary Internet Files directory. Where would be the best place to store any temporary or log files that my application generates?

+6  A: 

You best bet is to use isolated storage for temp files, but you can also use GetTempFileName.

JP Alioto
And an example from those docs: http://msdn.microsoft.com/en-us/library/6h2ws3ft.aspx
Michael Haren
+5  A: 

Is there a reason you can't use the default temporary directory? Essentially use the name returned from Path.GetTempFileName?

JaredPar
+2  A: 

Temporary Internet Files folder is different from the TEMP folder. I agree about not using the Temporary Internet Files folder - it is meant for a different usage.

The TEMP folder should be used for files that can be blown away without fear of crash.

The TEMP folder, however, is no place for log files or configuration files or anything of importance. I would create my own folder under the user's profile preferably in the Application Data or Local Settings.

Raj More