Most likely it is because your C# code is being compiled as x86 and Windows wants to keep backwards compatibility so Program Files points to the x86 version.
Compile as 64-bit and it will point to the 64-bit Program Files folder.
Now if you want your program to run on x86 versions of Windows you will need to compile as x86 and add some manual handling for this situation.