我可以在计算机上运行C#控制台应用程序作为Windows服务吗

我可以在计算机上运行C#控制台应用程序作为Windows服务吗

本文介绍了我可以在计算机上运行C#控制台应用程序作为Windows服务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近构建了一个C#控制台应用程序,它在我执行文件时工作正常。 
但是,客户要求我将其作为服务运行。如果没有我将整个应用程序重新编码为c#中的Windows服务应用程序,这是否可能?另一个缺点是,如果我转换它,我不熟悉编写Windows服务。

我试过按照https://www.howtogeek.com/50786/using-srvstart-to-run-any-application-as-a-windows-service/的说明,但是当我开始我的服务错误输出1067:进程意外终止。

我真的不确定此时该做什么。还有其他方法可以将我的控制台应用程序作为Windows服务运行而无需重新编码所有内容吗?

谢谢,
-h

我尝试过:

我已经创建了一个控制台应用程序运行没有问题,但客户要求我们将其作为服务运行。我对Windows服务一无所知,我想学习,但由于时间的限制,我正在寻找最有效的选择。

任何建议或帮助都非常感谢。

它已经有一段时间了,我真的开始再次学习c#。
解决方案

I recently built a C# console application and it is working fine when I execute the file.
However, the client requested that I run it as a service. Is that even possible without me recoding the entire application as a Windows Service app in c#? Another drawback is that I am not familiar with writing windows services if I convert it.
 
I have tried following instructions from https://www.howtogeek.com/50786/using-srvstart-to-run-any-application-as-a-windows-service/  but when I start my service it errors out with 1067:  The process terminated unexpectedly.
 
I am really unsure what to do at this point. Is there other way that I can run my console app as a windows service without having to re-code everything?
 
Thanks,
-h

What I have tried:

I already created a console app that runs without issues, but client requested we run this as a service. I know nothing about windows services, I want to learn but due to time constraint, Im looking for most efficient option possible.

Any suggestions or help really is much appreciated.

it has been a while and I am really starting to learn c# again.
解决方案


这篇关于我可以在计算机上运行C#控制台应用程序作为Windows服务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 09:12