System.ComponentModel.Win32Exception: Access is denied

T

tushar

Hello

I have windows 2003 server and asp.net 1.1, application.
It has used Enterprise library.

I got the following error,.


[Win32Exception (0x80004005): Access is denied]

[InvalidOperationException: Cannot open log for source {0}. You may
not have write access.]
System.Diagnostics.EventLog.OpenForWrite() +363
System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16
category, EventLogEntryType type, String[] strings, Byte[] rawData)
+280
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
+462
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID) +15
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type) +11

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances.ReportCounterFailure(String
message)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances..ctor(String
categoryName, String counterName, Boolean createNewInstance)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.AddPerformanceCounter(String
category, String[] counterNames, Boolean createNewInstance)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.Initialize(String
counterCategory, String[] counterNames, Boolean createNewInstance,
String eventLogSource, EventLogIdentifier[] eventIds)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent..ctor(String
counterCategory, String[] counterNames, Boolean createNewInstance)

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..ctor(String[]
counterNames)

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent..ctor(String[]
counterNames)

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent..cctor()

[TypeInitializationException: The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent"
threw an exception.]
Admin.CLASSES.DAL.Dal_AdminLogin.GetUserPassword(String
Admin_UserName) +74
Admin.CLASSES.BLL.Bll_AdminLogin.Login() +12
Admin.login.Button1_Click(Object sender, EventArgs e) +97
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +58
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1292

Please help in this.
Thanks
Tushar
 
G

Guest

It sounds as though the asp.net process does not have permission to
create\open\write to the log file that is defined by your ent. lib. logging
configuration.

What is the path where you are attempting to log too?

HTH

Ollie Riches

tushar said:
Hello

I have windows 2003 server and asp.net 1.1, application.
It has used Enterprise library.

I got the following error,.


[Win32Exception (0x80004005): Access is denied]

[InvalidOperationException: Cannot open log for source {0}. You may
not have write access.]
System.Diagnostics.EventLog.OpenForWrite() +363
System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16
category, EventLogEntryType type, String[] strings, Byte[] rawData)
+280
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
+462
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type, Int32 eventID) +15
System.Diagnostics.EventLog.WriteEntry(String message,
EventLogEntryType type) +11

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances.ReportCounterFailure(String
message)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounterInstances..ctor(String
categoryName, String counterName, Boolean createNewInstance)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.AddPerformanceCounter(String
category, String[] counterNames, Boolean createNewInstance)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent.Initialize(String
counterCategory, String[] counterNames, Boolean createNewInstance,
String eventLogSource, EventLogIdentifier[] eventIds)

Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent..ctor(String
counterCategory, String[] counterNames, Boolean createNewInstance)

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..ctor(String[]
counterNames)

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent..ctor(String[]
counterNames)

Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent..cctor()

[TypeInitializationException: The type initializer for
"Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEvent"
threw an exception.]
Admin.CLASSES.DAL.Dal_AdminLogin.GetUserPassword(String
Admin_UserName) +74
Admin.CLASSES.BLL.Bll_AdminLogin.Login() +12
Admin.login.Button1_Click(Object sender, EventArgs e) +97
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +58
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+33
System.Web.UI.Page.ProcessRequestMain() +1292

Please help in this.
Thanks
Tushar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top