安装Windows服务错误 - 'installutil.exe'未被识别为内部或外部命令 [英] Installing windows service error - 'installutil.exe' is not recognized as an internal or external command

查看:888
本文介绍了安装Windows服务错误 - 'installutil.exe'未被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2015 (专业版)中创建了Windows服务,.NET版本: 4.5.2

但是我无法在我的机器上安装这个Windows服务。



按照下面提到的步骤安装Windows服务



1 。开始>>所有程序>> Visual Studio 2015>> Visual Studio工具>>右键单击VS2015的开发人员命令提示符,然后单击以管理员身份运行



2.在VS 2015命令提示符下,键入Windows服务的位置。即CD C:\ Sandbox \ WindowServices \ MyNewService \ MyNewService \ bin \Debug



3.键入>> InstallUtil.exeMyNewService.exe命令



第3步应该安装Windows服务,但是我得到错误 'InstallUtil.exe'无法识别为内部或外部命令,

可操作程序或批处理文件。




----------------------------更多信息------------------

本地机器配置:

操作系统:Windows 7企业版

系统类型:64位

-----

InstallUtil.exe的位置:C:\ Windows \ Microsoftoft.NET \ Framework \ v4.0.30319





紧急寻求帮助。



提前致谢



我尝试过:



1.最初Windows服务在D驱动器,将其移动到C驱动器,仍然是相同的错误

2.将Windows服务exe移动到InstallUtil位置以及用于util位置和InstallUtil的CD命令。 exeMyNewService.exe,但是为窗口服务exe获取错误找不到文件

3.试图通过谷歌找到的批处理文件安装窗口服务,它给出了与找不到文件相同的错误

4.在Google上搜索了其他选项,但似乎没有什么特别针对我的问题。



注意:当我打开VS2015命令提示符时,它显示错误:无法确定VS Common Tools文件夹的位置。这是我罪魁祸首的罪魁祸首吗?如果是这样,如何在命令提示符中解决此错误。

I have created Windows Service in Visual Studio 2015 (Professional), .NET version: 4.5.2
But I am not able to install this windows service on my machine.

Followed below mentioned steps to install Windows Service

1. Start >> All Programs >> Visual Studio 2015 >> Visual Studio Tools >> Right Click "Developer Command Prompt for VS2015" and click "Run as administrator"

2. In VS 2015 Command Prompt, typed location of windows service. I.e. "CD C:\Sandbox\WindowServices\MyNewService\MyNewService\bin\Debug"

3. Typed >> InstallUtil.exe "MyNewService.exe" command

Step 3 is supposed to install Windows Service, but, instead I get error "'InstallUtil.exe' is not recognized as an internal or external command,
operable program or batch file.
"

---------------------------- More Info ------------------
Local machine configuration:
OS: Windows 7 Enterprise
System Type: 64 bit
-----
Location of InstallUtil.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319


Seeking for help on urgent basis.

Thanks in advance

What I have tried:

1. Initially windows service was at D Drive, moved it to C drive, still same error
2. Moved Windows service exe to InstallUtil location and both CD command for util location and InstallUtil.exe "MyNewService.exe", but get error "file not found" for the window service exe
3. Tried to install window service through a batch file found through google, it gives same error as "File Not Found"
4. Searched other options on Google, but nothing seems specific to my problem.

Note: When I open VS2015 Command Prompt it shows "ERROR: Cannot determine the location of the VS Common Tools folder." Is this culprit in my case? If so how to solve this error in command prompt.

推荐答案

您应首先导航到系统上存在InstallUtil.exe的路径,然后运行命令。



对于你来说,文件是在C下的presnet:\ Windows \ Mesrosoft.NET \ Framework \v4.0.30319



以管理员身份打开命令提示符,然后键入

You should first navigate to the path where InstallUtil.exe is present on your system and then run the commands.

For you the file is presnet under C:\Windows\Microsoft.NET\Framework\v4.0.30319

So open command prompt as administrator and then type
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319



从那里你可以使用


From there you can use

'InstallUtil.exe MyNewService.exe'


右键单击该文件并打开属性。您可能会看到一条消息 - 此文件来自另一台计算机,可能会被阻止以帮助保护此计算机。单击取消阻止按钮,然后单击应用/确定



然后尝试再次安装服务
right-click on the file and open Properties. You may see a message – This file came from another computer and might be blocked to help protect this computer. Click on the Unblock button and then on Apply/OK

then try to install service again


这篇关于安装Windows服务错误 - 'installutil.exe'未被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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