View Full Version : Managed Service Access Denied
oacej5v0l3
01-27-2005, 11:10 AM
I’m writing a Windows service in C# that needs to run in the NetworkService account, but when I create an Installer and set ServiceProcessInstaller.Account to NetworkService on an otherwise unaltered new project, I get an “Error 5: Access Denied” message when I try to start the service, even when logged in as Administrator.
nevarmore
01-27-2005, 06:22 PM
What does it do if you try and set the account to something else?
i.e ServiceProcessorInstaller.Account = Administrator
Whiteknight
01-28-2005, 10:07 AM
does your application have the necessary permissions to make such a call?
oacej5v0l3
01-28-2005, 11:11 PM
As it turns out, this was a monumentally stupid question.
I watched the "net start" command with filemon, and found out that the "access denied" message was caused by the fact that VisualStudio.NET was outputing the exe file in a subdirectory of my My Documents folder, which the "NETWORK SERVICE" user did not have access to.
Thanks for the suggestions; sorry for wasting your time.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.