C# – VirtualStore not working on Vista x64

cvirtualstorevisual-studio-2008win64

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.

Best Answer

Have more info about error ?
Do you use sysinternals tools for monitor execution/access errors ?
Take a look Event viewer for error too.