public void Start()
{
this.driverServiceProcess = new Process();
this.driverServiceProcess.StartInfo.FileName = Path.Combine(this.driverServicePath, this.driverServiceExecutableName);
this.driverServiceProcess.StartInfo.Arguments = this.CommandLineArguments;
this.driverServiceProcess.StartInfo.UseShellExecute = false;
this.driverServiceProcess.Start();
DateTime timeout = DateTime.Now.Add(TimeSpan.FromSeconds(20));
Uri serviceHealthUri = new Uri(this.ServiceUrl, new Uri("status", UriKind.Relative));
HttpWebRequest request = HttpWebRequest.Create(serviceHealthUri) as HttpWebRequest;
bool processStarted = false;
while (!processStarted && DateTime.Now < timeout)
{
try
{
request.GetResponse();
processStarted = true;
}
catch (WebException)
{
}
}
}