This happened to me because I was trying to install and run a 64-bit Windows Service binary that was included as a dependency in the output directory of an AnyCPU project. I had to switch the AnyCPU project to be 64-bit.