如何注册窗口服务的.dll文件。 [英] how to register .dll file of window service.

查看:78
本文介绍了如何注册窗口服务的.dll文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows服务。我希望在启动时运行此软件.dll file.so我从这个项目创建.dll文件。

创建.dll文件的过程: - 单击项目的属性。选择应用程序选项卡将输出类型从Windows应用程序更改为代码库,之后我选择build.and .dll文件是create.after我注册.dll文件

命令: - regsvr32 mydllfil.dll in运行,我也在命令提示符下编写命令。然后我复制.dll文件并粘贴c:\ windows \ system32文件夹,但它显示一个错误是

模块dllfile.dll(文件名)已加载但是条目找不到点dll注册服务器。确保dllfile.dll(filename)是一个有效的dll或ocx文件,然后再试一次。我正在寻找这个问题的解决方案1周,但我没有得到任何东西。所以请帮助我,请解决这个问题,请。



提前感谢....

i working with windows service.i want to run this software at start up by .dll file.so i created .dll file from this project.
the procedure of create a .dll file :- click to the properties of project. select application tab change output type from windows application to code library,after that i select build.and .dll file is create.after that i register the .dll file
command :- regsvr32 mydllfil.dll in run , i also wrote command in command prompt. and i copy the .dll file and paste c:\windows\system32 folder but it show one error that is
"the module "dllfile.dll"(file name) was loaded but the entry point dll register server was not found. make sure that "dllfile.dll"(filename) is a valid dll or ocx file and then try again." i was search the solution of this problem for 1 week but i didn't get anything. so please help me ,please give solution for this problem please ,please.

thanks in advance....

推荐答案

您不能只将Windows窗体应用程序的输出类型切换为.DLL并期望它作为服务工作。



首先,你遇到你遇到的问题。其次,您没有与Service Manager通信的代码,也没有用于设置和运行代码即服务的代码。



您别无选择,只能重写项目特别是作为Windows服务。人们通常从控制台应用程序开始,以开始此开发工作。我建议使用 TopShelf [ ^ ]使您的服务更容易开发。
You cannot just switch the output type of a Windows Forms app to .DLL and expect it to work as a service.

First, you run into the problems that you're experiencing. Second, you have no code that communicates with the Service Manager and no code to setup and run your code as a service.

You have no choice but to rewrite your project specifically as a Windows Service. People normally start with a Console application to start this development work. I suggest looking into using TopShelf[^] to make developing your service a lot easier.


除了解决方案1:请看我过去的答案:使用UI配置Windows服务 [ ^ ]。



-SA
In addition to Solution 1: Please see my past answer: Configure Windows Service with UI[^].

—SA


这篇关于如何注册窗口服务的.dll文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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