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
 
Back
Top