简体   繁体   English

C#-WiX Windows服务

[英]C# - WiX windows service

I have a WiX setup project that takes the output of ac# windows service. 我有一个WiX安装项目,该项目接受ac#Windows服务的输出。 I install the project and the service is created properly (in services.msc) and I can see the process in the task manager. 我安装了该项目,并且该服务已正确创建(在services.msc中),并且可以在任务管理器中看到该过程。

My Windows Service is a Server that binds to an IP:PORT and just listens for connections. 我的Windows服务是绑定到IP:PORT并仅侦听连接的服务器。

When I install the service using WiX the binding of the IP:PORT doesn't seem to occur, yet no error is given. 当我使用WiX安装服务时,似乎没有发生IP:PORT的绑定,但是没有给出错误。 I check netstat and I don't see the IP:PORT in the list. 我检查了netstat,但列表中没有看到IP:PORT。

On the other hand, when I use InstallUtil, it works properly. 另一方面,当我使用InstallUtil时,它可以正常工作。

Am I doing something wrong in WiX or is there something I need to change in my Service for it to work as it should? 我在WiX中做错了什么吗?我是否需要更改服务才能使其正常工作?

Using .NET 4.0 使用.NET 4.0

Thank you! 谢谢!

Assuming the same data set, whether you are using the SC command, the ServiceInstall Table or an installer class custom action launched by InstallUtil, the end state should be the same. 假设数据集相同,则无论您使用的是SC命令, ServiceInstall表还是InstallUtil启动的安装程序类自定义操作,结束状态都应该相同。

So either the data set isn't the same (username, password ectera ) or you have additional registration code being done in the custom action that's not expressed by the ServiceInstall table. 因此,要么数据集不同(用户名,密码ectera),要么在自定义操作中完成了其他注册代码,而这些代码未由ServiceInstall表表示。

It's hard to troubelshoot further without observing on a VM or looking at the installer custom action code. 在不观察VM或不查看安装程序自定义操作代码的情况下,很难进行进一步的故障排除。 I can say though that I've installed hundreds of Windows (NT) Services authored in .NET over the years and ServiceInstal is more then capable. 我可以说,尽管多年来我已经安装了数百个使用.NET编写的Windows(NT)服务,但ServiceInstal的功能却更加强大。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM