Pradeep Rawat

Pradeep Rawat

  • 1.8k
  • 237
  • 3k

run windows service from asp.net web page

Jul 30 2021 6:22 AM

getting error -- Cannot open triggerWindowsService1 service on computer '.'.--

below code i m using to start window service--- 

protected void Button1_Click(object sender, EventArgs e)
{
    try
    {
       System.ServiceProcess.ServiceController service = new System.ServiceProcess.ServiceController("triggerWindowsService1");
       service.Start();
    }
    catch (Exception ex)
    {

    }
}

 


Answers (1)