Hi,
My webservice is currently deployed on WIndows 2000 server and runs pretty
fine. I am trying to run my webservice on a Windows 2003 server. My
webservice tries to write to a eventlog. The code is as follows:
System.Diagnost ics.EventLog Log = new System.Diagnost ics.EventLog(
EventLogName );
Log.Source = EventLogName;
Log.WriteEntry( "PCHistory Service Application started up successfully.",
System.Diagnost ics.EventLogEnt ryType.Informat ion );
I am getting the following error.
System.Security .SecurityExcept ion: Requested registry access is not allowed.
at Microsoft.Win32 .RegistryKey.Op enSubKey(String name, Boolean writable)
at System.Diagnost ics.EventLog.Cr eateEventSource (String source, String
logName, String machineName, Boolean useMutex)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type, Int32 eventID, Int16 category)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type, Int32 eventID)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type)
at PCHistory.PCHis toryService.Log (String Message, EventLogEntryTy pe type)
at PCHistory.PCHis toryService.Log Info(String Message, Object[] args)
at PCHistory.PCHis toryService..ct or()
I tried the following:
1. Giving full rights to ASPNET account on
HKLM\System\Cur rentControlSet\ Services\Eventl og
2.Giving SetValue and CreateSubkey rights to ASPNET account on the same.
3.Changing machine .config process model attribute of USerName to SYSTEM.
4. Creating the Source manually in the registry.
Nothing worked.
If u have solution please reply ASAP.
Thanks
LP
My webservice is currently deployed on WIndows 2000 server and runs pretty
fine. I am trying to run my webservice on a Windows 2003 server. My
webservice tries to write to a eventlog. The code is as follows:
System.Diagnost ics.EventLog Log = new System.Diagnost ics.EventLog(
EventLogName );
Log.Source = EventLogName;
Log.WriteEntry( "PCHistory Service Application started up successfully.",
System.Diagnost ics.EventLogEnt ryType.Informat ion );
I am getting the following error.
System.Security .SecurityExcept ion: Requested registry access is not allowed.
at Microsoft.Win32 .RegistryKey.Op enSubKey(String name, Boolean writable)
at System.Diagnost ics.EventLog.Cr eateEventSource (String source, String
logName, String machineName, Boolean useMutex)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type, Int32 eventID, Int16 category)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type, Int32 eventID)
at System.Diagnost ics.EventLog.Wr iteEntry(String message, EventLogEntryTy pe
type)
at PCHistory.PCHis toryService.Log (String Message, EventLogEntryTy pe type)
at PCHistory.PCHis toryService.Log Info(String Message, Object[] args)
at PCHistory.PCHis toryService..ct or()
I tried the following:
1. Giving full rights to ASPNET account on
HKLM\System\Cur rentControlSet\ Services\Eventl og
2.Giving SetValue and CreateSubkey rights to ASPNET account on the same.
3.Changing machine .config process model attribute of USerName to SYSTEM.
4. Creating the Source manually in the registry.
Nothing worked.
If u have solution please reply ASAP.
Thanks
LP
Comment