How can I install a windows service onto a machine that doesn't have Visual Studio installed?

前端 未结 11 1816
悲&欢浪女
悲&欢浪女 2021-01-31 09:08

The only way to install windows-service I know is using \"Visual Studio 2008 Command Prompt\", Is there a way to install windows-service on a machine which isn\

11条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 09:54

    step 1> Install .net framework (I am using .net 4.0 but you can use as your requirement)

    step 2> Go to run + cmd then click ok or directly go to your window command prompt (not visual studio command prompt )

    step 3> type these lines

    > cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
    > E:\test\test\bin\Debug\test.exe
    

    E:\test\test\bin\Debug\ is the path where my window service setup is saved

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\ is path where InstallUtil.exe exist.

    In both InstallUtil.exe exist. and path must give a space. Otherwise, it raises an error.

    Step 4> Enjoy..your service is installed...now you can check it from control panel > administrative tool >Services.

提交回复
热议问题