Data access denied after Deployment

Hi all,
I'm fairly new to programming windows so I hope this question doesn't sound stupid. I'm working on a Windows Forms App that can save and load data to a .txt file for the program with StreamReader and StreamWriter. It works fine whenever I run the program from the .exe, however whenever I package the program in the setup project and install it on my Vista computer, I get a data access denied error for the file when trying to save. Loading from the file still works fine. Also, this error does not appear when I install the program on a Windows XP machine. Any ideas?

closed account (z05DSL3A)
Can you save the file to any location or is it fixed?

See the following, it may help:
[c++/cli] UnauthorizedAccessException while opening the exe file
http://www.cplusplus.com/forum/windows/12514/
The file can be moved anywhere. Thanks for that thread. The program will write correctly if I run it as an administrator, so it must just be the security issues.

Edit:
Moved the file to CommonApplicationData. Fixed the problem.
Last edited on
Topic archived. No new replies allowed.