Unable to profile a windows service

Memory profiling for .NET developers

Moderators: StephenC, Alex.Davies, AndrewH, melvyn.harbour

Unable to profile a windows service

Postby venuzr » Mon Feb 08, 2010 8:56 pm

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
venuzr
 
Posts: 1
Joined: Mon Feb 08, 2010 8:47 pm

Postby AndrewH » Tue Feb 09, 2010 11:45 am

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.
AndrewH
 
Posts: 134
Joined: Thu Aug 17, 2006 3:44 pm


Return to ANTS Memory Profiler Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests