How to install a Windows service developed in .NET 3.5?

前端 未结 4 1770
不知归路
不知归路 2021-02-04 15:12

I have developed a Windows service using Visual Studio 2008. I want to install that service in a machine where Visual Studio is not installed, but .NET 3.5 is installed.

4条回答
  •  执念已碎
    2021-02-04 15:26

    If you've been using InstallUtil.exe to install your Windows service, then that means you've added a ProjectInstaller component to your service. All the InstallUtil.exe does is use reflection to find the installer component embedded in your service and execute some methods on it. Due to this, you can modify your Windows service to install and uninstall itself, i.e., you no longer have to depend on InstallUtil.exe being available on the target machine. I've been using this successfully for several months now. Just follow the step-by-step I provided here. The idea originally belongs to Marc Gravell and this post.

提交回复
热议问题