I writing an interface for legacy application which reads data from windows directory.
So i need to write data into windows directory. (Windows 8 operating system)
I am using below code to get the windows folder path to write the file.
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "test.txt");
As i read on MSDN, if we run application, as normal user it writes data into virtual store windows folder, but it seems it not working. I am getting access denied error.
My application build with x86 platform.
Something I am missing or any constraints for window 8 OS.
Please assist, many thanks in advance.
I found the answer to my question in manifest file default comments provided. it says,
So you need to add the manifest file and remove requestedExecutionLevel node from xml or from project properties -> Application -> Icon and manifest -> under Manifest set
It has solved my problem.
Thanks,