views:

290

answers:

2

I've created a windows service in c# and I'm trying to install it for debug using the installutil as recommended here: http://msdn.microsoft.com/en-us/library/sd8zc8ha.aspx

The installutil says Install completed. However, nothing appears in the service control manager.

I've tried this on Server 2008 and XP with the same result.

Any ideas?

A: 

I can't speak specifically to any issues that are the fault of C# or .NET, but I have a writeup of what has to happen for a service to be installed and work in the form of an extensively documented framework (source code included) for writing services in Lua. I offer it up here as an example of another way to do it, because sometimes just seeing things from another point of view can be helpful.

Disclaimer: It is very much at an alpha quality level, and yes, I am its author.

The framework has all the code needed to interact with the Windows SCM to install and remove the service.

RBerteig
Not what I'm looking for.
Rob Stevenson-Leggett
That's fine. I put it out there mostly because noone had responded at all so far, and it is at least a fully worked example part of whose goal was to document what the relationship is between a service and the SCM.
RBerteig
+4  A: 

A colleague of mine had a more or less identical problem.

Did you add an installer to your project? For the service to be installed you need to add an installer to your Visual Studio Project. The easiest way to add an installer in Visual Studio is to open your service in Design Mode and right click the design area and select Add Installer. This will add a file ProjectInstaller.cs with itself contains a ServiceInstaller object and a ServiceProcessInstaller object. With the installer added you can set the Service Name, Description and other options that will be used when installing the service. If you now try to use InstallUtil your service should be installed and should show up in the Services list.

Rune Grimstad
I just noticed that you solved your problem. I'll leave my ansver in case someone else has the same problem.
Rune Grimstad
Well until Dmitriy Matveev posts his answer (he said the same in comments as you said) you have the points.
Rob Stevenson-Leggett