|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Windows Service Security ProblemI've run into a bit of an issue and I was hoping that someone here could help me. I have inherited a Windows Service written in .Net 2.0 (C#) from a previous employee. It build successfully and I am able to install it on the target machine via installutil but when I attempt to run it I receive a security error. First I receive the dialog telling me that the service could not be started "Error 1053: The service did..." and then "An unhandled exception of type 'System.Security.SecurityException' occurred in System.dll" . I've tried running the service on my local machine and opening the CLR debugger and the errors seems to be related to EventLog.WriteEntry. I've found the support article http://support.microsoft.com/?kbid=918122 and have added the EventLogPermission eventLogPermission = new EventLogPermission(EventLogPermissionAccess.Administer, "."); eventLogPermission.PermitOnly(); to no avail. Any help would be greatly appreciated. Make sure the Service is running under a user account that has the
permissions necessary. -- Show quoteHTH, Kevin Spencer Microsoft MVP Short Order Coder http://unclechutney.blogspot.com The devil is in the yada yada yada "bthubbard" <Brandon.Hubb***@gmail.com> wrote in message news:1161951234.716930.326680@b28g2000cwb.googlegroups.com... > Hello All, > I've run into a bit of an issue and I was hoping that someone here > could help me. I have inherited a Windows Service written in .Net 2.0 > (C#) from a previous employee. It build successfully and I am able to > install it on the target machine via installutil but when I attempt to > run it I receive a security error. First I receive the dialog telling > me that the service could not be started "Error 1053: The service > did..." and then "An unhandled exception of type > 'System.Security.SecurityException' occurred in System.dll" . I've > tried running the service on my local machine and opening the CLR > debugger and the errors seems to be related to EventLog.WriteEntry. > I've found the support article > http://support.microsoft.com/?kbid=918122 and have added the > > EventLogPermission eventLogPermission = new > EventLogPermission(EventLogPermissionAccess.Administer, "."); > eventLogPermission.PermitOnly(); to no avail. > > Any help would be greatly appreciated. > |
|||||||||||||||||||||||