简体   繁体   English

Installutil命令找不到Windows Service可执行文件

[英]Installutil command cannot find windows service executable

I have created a windows service and would like to test it however when I attempt to try and install the service using the developer command prompt I get this error : 我已经创建了Windows服务,并想对其进行测试,但是当我尝试使用开发人员命令提示符尝试安装该服务时,出现此错误

Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\BackUpService.exe' or one of its dependencies. 初始化安装时发生异常:System.IO.FileNotFoundException:无法加载文件或程序集“ file:/// C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ BackUpService.exe”或其依赖项之一。 The system cannot find the file specified.. 该系统找不到指定的文件..

the command i used was: installutil BackUpService.exe 我使用的命令是:installutil BackUpService.exe

I am not quite sure why I am getting this? 我不太确定为什么要得到这个?

It's look like you just forgot install(-i) word. 看起来您只是忘记了install(-i)字。

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe -i C:\BackupProject\bin\Debug\BackupService.exe

Use -u for uninstall. 使用-u进行卸载。

There is complete process of install & uninstall Windows Service on this link: https://stackoverflow.com/a/51788260/9888476 此链接上有完整的Windows Service安装和卸载过程: https : //stackoverflow.com/a/51788260/9888476

One way of figuring out what's missing here is by using Process Monitor . 解决这里遗漏的一种方法是使用Process Monitor You would want to use the icons on the top right to limit the captured events to "Show File System Activity" only otherwise you'll get heaps of irrelevant information. 您可能只想使用右上角的图标将捕获的事件限制为“显示文件系统活动”,否则您将获得大量无关的信息。

According to my understanding you are using InstallUtil.exe to install the windows service. 据我了解,您正在使用InstallUtil.exe安装Windows服务。 In that case you have to specify full path of the windows service exe file in the command. 在这种情况下,您必须在命令中指定Windows Service exe文件的完整路径。

Like this 像这样

>InstallUtil.exe "C:\\dev\\DBBackupService\\BackUpService.exe" > InstallUtil.exe“ C:\\ dev \\ DBBackupService \\ BackUpService.exe”

Hopefully this will work. 希望这会起作用。

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

相关问题 使用 InstallUtil 命令安装 Windows 服务失败 - Install Windows service failing with InstallUtil command 在安装期间使用 InstallUtil.exe 命令安装 windows 服务 - Install a windows service with InstallUtil.exe command during an installation 通过“无法启动服务……必须首先安装Windows服务(使用installutil.exe)……”的性能和诊断。 - Performance and diagnostics with “Cannot start service… A Windows Service must first be intalled (using installutil.exe)…” 不使用InstallUtil.exe安装Windows服务 - Install windows service without InstallUtil.exe InstallUtil无法安装自定义Windows服务 - InstallUtil fails on installing custom Windows Service 无法在InstallUtil工具的帮助下安装Windows服务 - Unable to install windows service with the help of InstallUtil tool 使用InstallUtil安装具有启动参数的Windows服务 - Using InstallUtil to install a Windows service with startup parameters 使用 installutil 从具有多个服务的可执行文件安装单个服务 - Use installutil to install a single service from an executable that has multiple services 如何找到Windows服务的可执行路径 - How to find executable path of a windows service 使用 InstallUtil 时可以将命令行参数传递给 Service 类吗? - Can command line arguments be passed to Service class when using InstallUtil?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM