13

i have windows 8 i have a windows application wrtitten with c# and on visual studio 2013 and want to install this application.

i open command prompt write:

c:\..\instalutil.exe c:\projectfolder\filename.exe

after i run this code it give me the error :

An exception occured during the Install phase.
System.InvalidOperationException: Cannot open Service Control Manager on computer '.'. This operation might require other privileges.
The inner exception System.ComponentModel.Win32Exception was thrown with the following error message: Access is denied.

This is my computer i dont know why it needs access right? and i dont know how to give right privilege.

also i changed my sercviceProcessInstaller Account property to LocalSystem and also tried with LocalService but both of them gives me the same error.

what should i do to give right privilege?

ercan
  • 825
  • 3
  • 16
  • 27

2 Answers2

30

I found the answer finally:

The solution: RUN COMMAND PROMPT AS ADMINISTRATOR

shA.t
  • 16,580
  • 5
  • 54
  • 111
ercan
  • 825
  • 3
  • 16
  • 27
  • Hi I have The same problem I Run this commond : `C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe E:\DataService\DataSrvice.exe` It works fine. – Eqbal Sohrabi Feb 29 '16 at 07:46
0

I encountered this problem myself, in my case, since I couldn't run "Developer Command Prompt for Visual Studio" explicitly from .exe file as administrator and create a shortcut to run it inside the Visual Studio using "Tools => External Tools". To work around the issue, I tried running Visual Studio as Administrator and it worked as well.

It seemed that it was the Visual Studio program that hadn't required access to perform the operations.

Homa
  • 134
  • 1
  • 6