为什么我在C#中安装Windows服务时遇到访问被拒绝的问题? [英] Why I am getting access denied issue on installing windows service in C#?
问题描述
我在安装Windows服务时遇到Access拒绝问题
错误如下:
'C:\ Windows \ Microsoft.NET\Framework\v2.0.50727\InstallUtil.InstallLog'被拒绝。关于安装Windows服务。
我尝试过:
尝试通过命令提示符安装Windows服务,如下所示。
'C:\ WindowsD.Microsoft.NET \ Framework\v2.0.50727 \InstallUtil.InstallLog'被拒绝。关于安装Windows服务。
打开命令提示符然后添加
cd C:\ Windows \ microsoft.NET \ Framework \v2.0.50727 \
然后在命令下面添加
installutil.exeD:\New folder(5)\PDF_Data_Tool.exe
I am getting Access denied issue on installing windows service
Error is as below:
'C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.InstallLog' is denied. on installing windows service.
What I have tried:
Tried installing windows service via command prompt as below.
'C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.InstallLog' is denied. on installing windows service.
Opened command prompt and then added
cd C:\Windows\Microsoft.NET\Framework\v2.0.50727\
Then added below command
installutil.exe "D:\New folder (5)\PDF_Data_Tool.exe"
推荐答案
您需要以管理员身份运行安装 - 您可以通过在菜单上右键单击并选择以管理员身份运行
you need to be running the install as Administrator - you can do this for a command prompt by right clicking it on the menu and selecting 'Run As Administrator'
如果激活UAC,安装服务需要您以提升模式发出命令。
在您描述的过程中,替换打开的命令提示符 with右键单击命令提示符图标,然后单击以管理员身份运行。
Installing a service requires you to issue your command in elevated mode, if UAC is activated.
In the process you describe, replace "Opened command prompt" with "Right-click on command prompt icon, and click Run as administrator".
这篇关于为什么我在C#中安装Windows服务时遇到访问被拒绝的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!