I have created a window service and set some dependencies like on MSMQ, MSSQLSERVER and so. Everything is working nice. but i need to send another dependency for my service. That is on internet connection. My service is responsible for sending emails. As soon my server starts, my service starts too and it finds if there is anything to send, if there is, it starts to send email, if during sending it is not able to connect to the internet it cannot send email.

so i guess i should set my service dependency on internet connection too. I already set my window service dependency to MicrosoftSQL Server and Microsoft Message Queuing by editing the registry value.

by adding new multi string value named "DependOnService", Type "REG_MULTI_SZ" and space separated names of the services that my service depends upon for the Data.

For Microsoft SQL Server i set the value to "MSSQLSERVER" but i don't know the name of the internet service that i need to set dependency upon.

how can i do this, any help please Thanks


This shouldn't have been migrated because the solution is programmatic. Have your service test the Internet connectivity before trying to send the messages. If there's no connection (e.g. ping an IP address that can be relied on to be there, such as your ISP's gateway), sleep for a bit and try again.

| improve this answer | |

I'm having this same issue with a windows service where the service expects to listen on an IP address that hadn't been readied yet. I added a dependency to Netman (Network Connections) and also to SQL Server (which the service also depends on). Rather than muck with the registry, I used the command line, as such:


Be sure to replace your server name and your service name. If successful, you should see:

[SC] ChangeServiceConfig SUCCESS

I'm waiting to confirm this works until the next weekly reboot, but it should!

| improve this answer | |
  • I think depend= tcpip/dhcp/dnscache would make more sense. – tmm1 Nov 2 '17 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy