Registry access error in ApplicationBlocks.ExceptionManagement when using Custom Publisher<p>I am trying to write and use a custom publisher that will write the errors to a text file. I have deployed it and tested it , it runs fine on my machine. My web.config settings are as follows:<br/><br/><em> &lt;configSections&gt;<br/>  &lt;section name=&quot;exceptionManagement&quot; type=&quot;Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement&quot; /&gt;<br/> &lt;/configSections&gt;<br/> &lt;exceptionManagement&gt;<br/>  &lt;publisher mode=&quot;on&quot; assembly=&quot;CustomExceptionManager&quot; type=&quot;CustomExceptionManager.CustomPublisher&quot; fileName=&quot;E:\Logs\EIS\ExceptionLog.txt&quot; /&gt;<br/> &lt;publisher mode=&quot;off&quot; assembly=&quot;Microsoft.ApplicationBlocks.ExceptionManagement&quot; type=&quot;Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher&quot; logName=&quot;AdiWeb&quot; applicationName=&quot;EIS&quot; /&gt;<br/> &lt;/exceptionManagement&gt;</em><br/><br/>Whenever an error occurs in my code, error get logged to the txt file specified.<br/><br/>But when i deploy this code to a server, i get the following error. Why is it even trying to go to EventLog? i am not writing anything there.<br/><br/>Any pointers would be very helpful! Note: My server in a Windows 2003 machine , appln is running on .Net 2.0<br/><br/>Regards,<br/>Lopa<br/><br/><em>Security Exception <br/>Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. </em></p> <p><em>Exception Details: System.Security.SecurityException: Requested registry access is not allowed.<br/><br/>Stack Trace: </em></p> <p><br/><em>[SecurityException: Requested registry access is not allowed.]<br/>   System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +48<br/>   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +2752377<br/>   System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) +360<br/>   System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName) +212<br/>   System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +211<br/>   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +80<br/>   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) +14<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.WriteToLog(String entry, EventLogEntryType type) +37<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exception exception, NameValueCollection additionalInfo, NameValueCollection configSettings) +1606<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInternalException(Exception exception, NameValueCollection additionalInfo) +74<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception, NameValueCollection additionalInfo) +932<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception) +27<br/>   EIS.EISReporting_Category_Menu.Page_Load(Object sender, EventArgs e) +2574<br/>   System.Web.UI.Control.OnLoad(EventArgs e) +99<br/>   System.Web.UI.Control.LoadRecursive() +47<br/>   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6978<br/>   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213<br/>   System.Web.UI.Page.ProcessRequest() +86<br/>   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18<br/>   System.Web.UI.Page.ProcessRequest(HttpContext context) +49<br/>   ASP.eisreporting_category_menu_aspx.ProcessRequest(HttpContext context) +29<br/>   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303<br/>   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64</em><br/></p>© 2009 Microsoft Corporation. All rights reserved.Wed, 08 Apr 2009 07:58:00 Z4e990ca9-54f8-44b1-b102-e81b1f5f19d2http://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/4e990ca9-54f8-44b1-b102-e81b1f5f19d2#4e990ca9-54f8-44b1-b102-e81b1f5f19d2http://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/4e990ca9-54f8-44b1-b102-e81b1f5f19d2#4e990ca9-54f8-44b1-b102-e81b1f5f19d2lopamudra_dashttp://social.msdn.microsoft.com/Profile/en-US/?user=lopamudra_dasRegistry access error in ApplicationBlocks.ExceptionManagement when using Custom Publisher<p>I am trying to write and use a custom publisher that will write the errors to a text file. I have deployed it and tested it , it runs fine on my machine. My web.config settings are as follows:<br/><br/><em> &lt;configSections&gt;<br/>  &lt;section name=&quot;exceptionManagement&quot; type=&quot;Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement&quot; /&gt;<br/> &lt;/configSections&gt;<br/> &lt;exceptionManagement&gt;<br/>  &lt;publisher mode=&quot;on&quot; assembly=&quot;CustomExceptionManager&quot; type=&quot;CustomExceptionManager.CustomPublisher&quot; fileName=&quot;E:\Logs\EIS\ExceptionLog.txt&quot; /&gt;<br/> &lt;publisher mode=&quot;off&quot; assembly=&quot;Microsoft.ApplicationBlocks.ExceptionManagement&quot; type=&quot;Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher&quot; logName=&quot;AdiWeb&quot; applicationName=&quot;EIS&quot; /&gt;<br/> &lt;/exceptionManagement&gt;</em><br/><br/>Whenever an error occurs in my code, error get logged to the txt file specified.<br/><br/>But when i deploy this code to a server, i get the following error. Why is it even trying to go to EventLog? i am not writing anything there.<br/><br/>Any pointers would be very helpful! Note: My server in a Windows 2003 machine , appln is running on .Net 2.0<br/><br/>Regards,<br/>Lopa<br/><br/><em>Security Exception <br/>Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. </em></p> <p><em>Exception Details: System.Security.SecurityException: Requested registry access is not allowed.<br/><br/>Stack Trace: </em></p> <p><br/><em>[SecurityException: Requested registry access is not allowed.]<br/>   System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +48<br/>   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +2752377<br/>   System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) +360<br/>   System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName) +212<br/>   System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +211<br/>   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +80<br/>   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) +14<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.WriteToLog(String entry, EventLogEntryType type) +37<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exception exception, NameValueCollection additionalInfo, NameValueCollection configSettings) +1606<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInternalException(Exception exception, NameValueCollection additionalInfo) +74<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception, NameValueCollection additionalInfo) +932<br/>   Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exception exception) +27<br/>   EIS.EISReporting_Category_Menu.Page_Load(Object sender, EventArgs e) +2574<br/>   System.Web.UI.Control.OnLoad(EventArgs e) +99<br/>   System.Web.UI.Control.LoadRecursive() +47<br/>   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6978<br/>   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213<br/>   System.Web.UI.Page.ProcessRequest() +86<br/>   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18<br/>   System.Web.UI.Page.ProcessRequest(HttpContext context) +49<br/>   ASP.eisreporting_category_menu_aspx.ProcessRequest(HttpContext context) +29<br/>   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303<br/>   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64</em><br/></p>Wed, 08 Apr 2009 07:57:58 Z2009-04-08T07:57:58Z