The handle is invalid at System.Diagnostics.EventLog.InternalWriteEvent
- We have started getting this error and really don't know why:
System.ComponentModel.Win32Exception: The handle is invalid at System.Diagnostics.EventLog.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName) at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Byte[] data, Object[] values) at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Object[] values) at System.Diagnostics.EventLogTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType severity, Int32 id, String message) at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message) at Microsoft.Commerce.Common.Logger.InternalLog(TraceSource traceSource, TraceEventType eventType, Int32 eventId, String message) at Microsoft.Commerce.Common.LoggingExceptionHandler.HandleException(Exception exception) at Microsoft.Commerce.Common.ExceptionManager.HandleException(String policyName, Exception exception) at Microsoft.Commerce.Common.ExceptionManager.HandleException(Exception exception) at Microsoft.Commerce.Portal.UI.Catalog.WebParts.ProductQuery.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
All Replies
- Windows Event Helper C# "Integration with EventLog"::
http://ledomoon.blogspot.com/2008/08/windows-event-helper-c-with-eventlog.html
Waleed Mohamed Hi Jay,
Did you get any solution to the above proble. I am also getting s similar problem.
The stack trace is :
[System.ComponentModel.Win32Exception: The handle is invalid]
at System.Diagnostics.EventLog.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Byte[] data, Object[] values)
at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Object[] values)
at System.Diagnostics.EventLogTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType severity, Int32 id, String format, Object[] args)
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at System.Diagnostics.Trace.TraceError(String format, Object[] args)
at XtenderSolutions.Utility.Logging.CMTrace.Error(Exception exp, String message)
at XtenderSolutions.Web.UI.ASPNetExtension.WxPage.OnError(EventArgs e)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.login_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
- I did not. It seemed to go away on its own. Not sure if an iisreset fixed it or what.. but i would love to see the correct solution

