从DLL .NET Windows服务 [英] .NET Windows Service from dll

查看:245
本文介绍了从DLL .NET Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows服务和服务安装的.NET类库(不是一个exe)里面。

I have a Windows Service and Service Installer inside of a .NET class library (not an exe).

在该服务通过installutil安装,尝试启动,我得到的错误

Once the service is installed via installutil, when trying to start, I get the error

Windows could not start the xxx service on Local Computer  
Error 193: 0xc1

在谷歌上搜索,我发现这个错误可能是由于这样的事实,我的服务是一个DLL,而不是exe文件的一部分。难道这是问题吗?如果是这样,我怎么能解决这个问题?如果没有,还有什么可能是这个问题。

In googling I found that this error might be due to the fact that my service is part of a dll, not an exe. Could this be the problem? If so, how can I resolve the issue? If not, what else could be the problem.

推荐答案

在VS.NET到新项目/的Windows / Windows服务,覆盖的服务,并用自己的安装类。然后你可以使用installutil上编译EXE文件。有没有办法,你可以从一个.dll安装Windows服务

In VS.NET go to New Project/Windows/Windows Service, overwrite the service and install classes with your own. Then you can use installutil on the compiled exe file. There is no way you can install a windows service from a .dll

这篇关于从DLL .NET Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆