Debugging Windows Service

Tech-Archive recommends: Fix windows errors by optimizing your registry



As a newbie to Windows Service programming in VB.Net, I need some
clarification. I am writing a Windows Service that works with SQL Server. It
works fine as a console application, but when I run it as a service it is
having problems. I want to be able to debug it, so I placed this code in
the OnStart routine which allows me to break into the code:

System.Diagnostics.Debugger.Launch()
System.Diagnostics.Debugger.Break()

It looks like the only way I am allowed to debug the process is setting the
logon in the service (once it is installed of course) to the Local System
Account and choosing "Allow service to interact with desktop." But it looks
as if Local System does not have access to SQL Server, as I am getting an
"Unable To Connect To Server" error. Should Local System have access?

Derek



.



Relevant Pages

  • Re: Debugging Windows Service
    ... I am writing a Windows Service that works with SQL Server. ... I want to be able to debug it, ... it looks as if Local System does not have access to SQL Server, ...
    (microsoft.public.dotnet.general)
  • Re: sql server does not exist
    ... You can change the service account to Local System via Windows service ... Repeat for SQL Server agent. ...
    (microsoft.public.sqlserver.server)
  • Re: Debugging Windows Service
    ... Check the SQL Server. ... clarification. ... It looks like the only way I am allowed to debug the process is setting ... it looks as if Local System does not have access to SQL Server, ...
    (microsoft.public.dotnet.general)
  • Re: testing with sql server
    ... Regarding your SQL Server 2000 debugging problems, ... version to debug with a sql server 2000 database. ... My goal is to debug some t-sql commands. ... attach to a process and the process that I need to attach to is ...
    (microsoft.public.sqlserver.setup)
  • Re: Windows Services GUI
    ... Open a form from a Windows Service ... SQL Server has a number of Windows Services that run, ... have multiple custom commands defined. ... Remoting Server, in which case you call a method to have it perform some ...
    (microsoft.public.dotnet.languages.vb)