windows service networkconnection issue

  • Thread starter Thread starter George Jin
  • Start date Start date
G

George Jin

My windows service program can not connect to the internet. But if it runs
as a stand along program, it looks perfectly and can connect internet. ANy
one knows why my windows service can not connect the the internet? and even
can not resole the host name by dns! following is my code snippet
HttpWebRequest aRequest = (HttpWebRequest)WebRequest.Create(uri);

aRequest.GetResponse();
 
My windows service program can not connect to the internet. But if it runs
as a stand along program, it looks perfectly and can connect internet. ANy
one knows why my windows service can not connect the the internet? and even
can not resole the host name by dns!?

Maybe you need to delay the loading of your service after the network
services for the machine have started. Do this by setting dependencies for
your service.

Hope that helps,
-JG
 
George Jin said:
My windows service program can not connect to the internet. But if it runs
as a stand along program, it looks perfectly and can connect internet. ANy
one knows why my windows service can not connect the the internet? and even
can not resole the host name by dns! following is my code snippet
HttpWebRequest aRequest = (HttpWebRequest)WebRequest.Create(uri);

aRequest.GetResponse();

i would recommend catching any exception and logging them to the EventLog.
this is most likely a permissions problem.

vince
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top