Why can't I install my service (runtime newer than loaded runtime)?
You are using the wrong installutil.exe If your application is built against .Net 4.0. Use the the installutil.exe in the 4.0 folder.
For x86:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe
For x64:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
Nobody even came close to getting this one!
Here's what I had to do:
- Right-click the service project in Visual Studio, go to "Properties"
- Set "Startup object" to the name of the service (it had been set to the value "(Not Set)").
- Save.
- Build
- Try to install again.
- It works! Yay! We can all go home!
Link to the code project article that helped:
For those of you who don't find that this fixes their problem you need to look in the Launch conditions of the .vdproj file and change the .NET framework to 4: http://www.alexjamesbrown.com/uncategorized/deploying-net-4-project-error-1001-system-badimageformatexception/