问题描述
使用Visual Studio Express 2012,我使用Topshelf(版本3.1.107.0)创建了一个控制台应用程序。该应用程序可以用作控制台应用程序,但是我不知道如何将其安装为服务。我已经在Visual Studio中发布了该项目(构建,发布),以管理员身份启动了命令提示符,导航到发布应用程序的文件夹,然后从命令提示符处运行setup.exe -install。该应用程序已安装并运行,但作为控制台应用程序而非Windows服务运行。我在这里想念的是什么?
Using Visual Studio Express 2012, I've created a console application using Topshelf (Version 3.1.107.0). The application works as a console application, but I can't figure out how to install it as a service. I've published the project from within Visual Studio (Build, Publish), started a command prompt as Administrator, navigated to the folder where the application was published, and run setup.exe -install from the command prompt. The application is installed and runs, but as a console application, not a Windows service. What am I missing here?
对于那些可能不熟悉Topshelf的人来说,它是.Net的Windows Service框架,应该有助于我上面描述的场景-作为控制台应用程序进行开发和调试,作为Windows Service进行部署。请参见。
For those who may not be familiar with Topshelf, it is a Windows Service framework for .Net and is supposed to facilitate the scenario I describe above - develop and debug as a console application, deploy as a Windows Service. See the documentation at http://docs.topshelf-project.com/en/latest/index.html.
推荐答案
运行 service.exe install
来安装服务。
请参见文档。
这篇关于将Topshelf应用程序安装为Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!