During the last week I was asked to write a windows service, something I have done quite a few times in my career, but this time when I tried to install my service on a test PC it broke with the error “system.invalidoperationexception: unable to get installer types”. The funning thing is that it is working on a test server.
The solution to this problem turned out to be quite simple:
When running InstallUtil.exe it has to be run from the .Net folder matching your machines setup, for instance if you have a 64Bit machine you have to run InstallUtil.exe from the 64Bit .Net folder “C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe” and for a 32Bit machine you can use the normal .Net folder “C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe”
The reason this was working on a test server was because the test server is running on a 32Bit virtual machine.
Normally when I create windows services they go directly to a dev/test environment, I usually don’t bother running them on my local machine or a test PC.
Hope that this post help’s someone in the future Smile