Currently, the check whether we run 32/64 bit is kind of wrong.
You could have a 64 bit machine, while IIS (or IIS Express) can be running in 32-bit. Which will cause an invalid result because we check on the machine: Environment.Is64BitProcess
I would be better if we checked on the current process whether it is 32 or 64 bit?
Looking for a solution, I came across this : https://stackoverflow.com/a/397695/97615
if (IntPtr.Size == 8)
{
// 64 bit machine
}
else if (IntPtr.Size == 4)
{
// 32 bit machine
}