安装没有InstallUtil.exe的.NET Windows服务

编程入门 行业动态 更新时间:2024-10-21 03:33:02
本文介绍了安装没有InstallUtil.exe的.NET Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可以在不使用InstallUtil的情况下自行安装吗? 我应该使用服务安装程序类吗?我应该如何使用它?

我想能够调用以下内容:

MyService.exe -install

它将具有与调用相同的效果:

InstallUtil MyService.exe

解决方案

是的,这是完全可能的(即我这样做);您只需要引用正确的dll(System.ServiceProcess.dll)并添加一个安装程序类...

这是一个例子。

I have a standard .NET windows service written in C#.

Can it install itself without using InstallUtil? Should I use the service installer class? How should I use it?

I want to be able to call the following:

MyService.exe -install

and it will have the same effect as calling:

InstallUtil MyService.exe

解决方案

Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class...

Here's an example.

更多推荐

安装没有InstallUtil.exe的.NET Windows服务

本文发布于:2023-11-05 08:16:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560335.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:exe   InstallUtil   Windows   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!