Instantiating ServiceController takes sometimes too much time

Posted by mrbamboo on Stack Overflow See other posts from Stack Overflow or by mrbamboo
Published on 2010-05-14T15:47:32Z Indexed on 2010/05/15 9:34 UTC
Read the original article Hit count: 402

Hi,

i am creating an instance of ServiceController using a remote/local machine name and the name of the service. When I type sth. like stackoverflow.com as machine name the contructor blocks for a long time and returns an exception.

Example:

string MachineName = "stackoverflow.com"
ServiceController("RemoteRegistry", MachineName );

How can I set here a kind of timeout to cancel this process?

© Stack Overflow or respective owner

Related posts about servicecontroller

Related posts about remote-registry