Windows 7 64-bit programfiles environment variable

environment-variablesvisual studio 2010windows 7

Does anyone know if windows 7 will somehow defer back to the "ProgramFiles(X86)" environmental variable when the "ProgramFiles" variable is used?

We have a situation where a developer is using visual studio and the proj file references assemblies using "$(ProgramFiles)". The machine is 64-bit and the "ProgramFiles" variable points to "C:\Program Files", however the assemblies are in "C:\Program Files (X86)" yet the project builds. It does not build if the literal "C:\Program Files" path is used. The compiler says it cannot find the assemblies

Best Answer

Yes, Windows automatically maps folder and file access to c:\program files for 32-bit programs to c:\program files (x86). Visual Studio as well as MSBuild are 32-bit programs. Same is true for c:\windows\system32 vs c:\windows\syswow64.