Re: Debugging a service - without rebooting?

From: Catherine Rees Lay (spamtrap_at_polyhedron.org.uk)
Date: 03/29/04


Date: Mon, 29 Mar 2004 13:23:43 +0100

In article <ea69c.125939$Wa.110872@news-server.bigpond.net.au>, David
Reeve <dree4456@big-pond.net.au> writes
>
>"Catherine Rees Lay" <spamtrap@polyhedron.org.uk> wrote in message
>news:PicLTiB9eAZAFwxT@spamtram.polyhedron.com...
>> Sorry, I seem to be asking rather a lot of questions at the moment!
>>
>> I currently have a problem with rebuilding and debugging my service
>> application. This is what happens from scratch (service not installed at
>> all):
>>
>> Install service from command prompt with /INSTALL and start it in the
>> Services window
>> Use Attach to Process to run/debug service app. This works fine.
>> Oh dear there's a bug in my service app. Fix it and recompile. "Unable
>> to create exe file".
>> Fine since service is still running. Stop it (in Services) and
>> recompile. No error messages.
>> Start service again (in Services)
>> Use Attach to Process. "Source has been changed. Rebuild?"
>> If I say Yes, I just go round the loop again. If I say No it runs quite
>> happily but I have no breakpoints (so not much use for debugging) and
>> I'm reasonably sure it's actually running the previous version.
>>
>> Last option: command prompt and /UNINSTALL. Says it works, but if I
>> subsequently try to do /INSTALL it says "This service has been marked
>> for deletion" and won't do it until the machine is rebooted.
>>
>> Surely I don't have to reboot each time I change my service app code?
>> Right now my only option would seem to be a testbed project which isn't
>> a service and put it back into my service app once it's fully debugged.
>> But in that case the facility to debug a service seems pretty useless.
>>
>> I'm running Windows 2000 Pro and Delphi 7.
>>
>> Any suggestions welcome - I can upgrade my OS if that's the problem, but
>> would prefer not to otherwise!
>>
>
>Hmmm.... seem to remember something about this in help. Have you looked for
>services, debugging? There is no entry for debugging, services (at least in
>D5)
>
>Seems your problem is to do with installing the service. Try this from
>help....
>
>"1 First, launch the application in the debugger. Wait a few seconds until
>it has finished loading.
>2 Quickly start the service from the control panel or from the command line:
>
>net start MyServ
>
>You must launch the service quickly (within 15-30 seconds of application
>startup) because the application will terminate if no service is launched."
>
>Dave
>
Sadly, this doesn't work either - the application just terminates. My
suspicion is that the service I've started is the old, previously
installed one and the newly compiled one doesn't link to it.

The D7 help does have help on debugging service applications, which have
as the 2 alternatives what I did initially, and what you suggest. Either
works provided the service installed with /INSTALL is the identical
version to that I'm trying to debug. But there's no help on how to
recompile the service's executable and then debug that without a reboot
between uninstalling the old service and installing the fixed version.
I'm starting to think it can't be done. But I'd still like to know if
this limitation exists under XP.

Thanks,

Catherine.

-- 
Catherine Rees Lay
To email me, use my first name in front of the "at".


Relevant Pages

  • RE: Debugging OEMUNI Sample
    ... You need to install a checked build of oemuni.dll in order to be able to debug it. ... Here is some information on debugging print drivers in general. ... Installing the debugging tools ... Install the oemuni sample on the "FILE:" port. ...
    (microsoft.public.development.device.drivers)
  • RE: "Error while trying to run project: Unable to start debugging" - p
    ... With embedded Visual C++ i can debug. ... > After a successful deployment, I see the following in the Build Output ... > Error while trying to run project: Unable to start debugging. ... > - Tried installing the Microsoft Loopback Adapter ...
    (microsoft.public.pocketpc.developer)
  • shader/dx debugger not starting
    ... After installing the dx 2005 june sdk, I have the menu option "start with ... If i hit "start without debugging" and then attatch the debugger, ... conplains about the shader not having any debug info and again it doesnt let ... I have now been installing, removing, loaded clean system image, tried some ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Help! Stuck in .Net Framework SDK hell...
    ... Then anything that crashes and needs debugging ... Up until recently (perhaps before installing some recent microsoft ... "This component cannot be installed on Microsoft Windows 95, Windows 98, ...
    (microsoft.public.scripting.vbscript)
  • Access is denied + Unable to start debugging..HELP
    ... trying to run project: Unable to start debugging. ... Access is denied..blah blah ... I WAS able to debug successfully before installing .NET framework 2.0. ...
    (microsoft.public.dotnet.framework)