I'm trying to install a .NET 4 Windows Service on a production server: Running InstallUtil.exe gives me this error message:
Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///D:\myservice.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..
Obviously, it's complaining about the service being written in .NET 4. But the framework is correctly installed on the server as I have other .NET 4 apps running. This is the first time I'm trying to install a service.
I did a bit of googling, and have tried setting the "Target CPU" to "AnyCPU" under Advanced Compiler Settings. What else am I missing?