I have a little tray application that wants to write to its own folder under the Program Files directory. I know this is not an ultimate design and I will fix it, but first I want to understand how this works.
Running this on a 32-bit Vista machine it writes the files to the VirtualStore and it works just like it should.
But when installing this on a Vista 64-bit machine I immediately get hit with an UnauthorizedAccessException for trying to write to the directory within Program Files (and Program Files (x86)).
The VirtualStore redirect does not seem to work on Vista 64-bit. Any ideas?
It's a C# app written in Visual Studio 2008 and I use a FileStream obj to persist the stream to disk.
So I actually got this working by compiling all projects to target platform x86. So x64 does not work with VirtualStore on Vista 64 and neither does compiling to "Any CPU". And I had to set it for the entire solution (in the Configuration Manager), just setting it for each individual project didn't work.
Time to rewrite it using AppData folder or IsolatedStorage. Thanks for all the help!