Re: Debugging Windows Service

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Check the SQL Server. It depends on how permissions are configured for the
SQL Server.

--
HTH,

Kevin Spencer
Microsoft MVP
Logostician
http://unclechutney.blogspot.com

Parabola is a mate of plane.


"Derek Hart" <derekmhart@xxxxxxxxx> wrote in message
news:uX79SWlFHHA.5104@xxxxxxxxxxxxxxxxxxxxxxx
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: 18456 Login failed for user NT AUTHORITYSYSTEM
    ... No, not using fulltext Searching. ... problem and had ruled it out but had not though about tracing the account. ... > system and is unable to connect to SQL server. ... > SQLSERVERAGENT - but I'm sure it's not running under local system.) ...
    (microsoft.public.sqlserver.server)
  • Re: I set: Local and remote connections/Using both TCP/IP and Named Pipes
    ... I changed to Local System ... Using both TCP/IP and Named Pipes ... Go to configuration manager right click on SQL Server Express ...
    (microsoft.public.sqlserver.programming)
  • 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)
  • Debugging Windows Service
    ... I am writing a Windows Service that works with SQL Server. ... It looks like the only way I am allowed to debug the process is setting the ... logon in the service to the Local System ...
    (microsoft.public.dotnet.general)
  • SQL Server 2005 Service Accounts Questions / Seeking Recommendations
    ... I selected 'Local System' and then later used SQL ... accounts to a specific, non-built-in, local user. ... If I had created this local account prior to running SQL Server 2005 Setup, ...
    (microsoft.public.sqlserver.security)