Could someone tell me, why my program writes/reads files to/from both folders after I installed it using VS Setup Projects? On first start, when I launch the program and save something in my program to a file, it writes it to:
C:\Users\UserName\AppData\Local\VirtualStore\Program Files (x86)\Company Name\Program Name\"
After setup "run on system start", I restart the computer and the Program starts, but this time it reads and writes from/into this folder:
C:\Users\UserName\AppData\Local\VirtualStore\Windows\SysWOW64
So that it loads wrong values or nothing on second start. It looks like it depends on how I start the Program, via Desktop Symbol or by Autorun on Systemstart.
How can I prevent this and how do I let the program always read/write from the same folder? I would prefer to save the files always in the root folder, where the exe is (C:\Program Files(x86)\CompanyName\ProgramName).
I think the problem is somewhere in VS Setup Projects or it is because it is a 32bit Application running on a 64bit System. I already looked for solutions in other questions, but it didn't help, instead it didn't read anything. Hope someone can help me, thank you!
That's how I write a file: File.WriteAllText(@"mailstate2", "true");
I don't give a path... I just want it to be saved in the root folder...