Unable to profile a windows service

I am unable to start a profiling session on a custom windows service and am hoping you can help me. This service implements System.ServiceProcess.ServiceBase and I have it installed on my Windows Service Manager and am able to start it and stop it.

The error that I get is
Could not launch the task to be profiled.
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException
at eU.Launch()
at RedGate.Memory.Controller.Session.ProfilerSession.i()

Caused by:

Object reference not set to an instance of an object.
System.NullReferenceException
at eT.a(String )
at eT.b()
at fe.PerformLaunch()
at eU.Launch()

Your help is appreciated.

Thanks
Venu

Comments

  • There are two possibilities for this error: either there is a problem with WMI on your system (we use this to determine the process ID of the service if it's running), or ANTS is unable to determine the registry key for your service. The latter is more likely, I think.

    The service should have a key at HKEY_LOCAL_MACHINE\CurrentControlSet\Services\<Name>, where <Name> matches the name in the drop-down, which should in turn have an ImagePath key. If it's missing, then it looks like ANTS will give this exception (though if it's missing it's odd that the service is able to start at all). It's possible that ANTS is case sensitive.

    If the key is not present, or the name doesn't exactly match the list, can you let me know what the difference is?

    You might be able to fix this problem by deregistering and reregistering the service.
    Andrew Hunter
    Software Developer
    Red Gate Software Ltd.
Sign In or Register to comment.