Advertisement

10.09.2006 at 10:40PM PDT, ID: 22018652
[x]
Attachment Details

Security Exception in EventLog.CreateEventSource()

Asked by anugrah in C# Programming Language

Tags: exception, security

Hi ,
Below pasted is the code where i am getting security exception in my ASP.NET WebServices application,
Exception is thrown from the line pointed by arrows and the values in different variables is also given below:

            private void VerifyValidSource()
            {
                  try
                  {
                         if (!EventLog.SourceExists(applicationName))
                         {    
   ------------------------------->>>      EventLog.CreateEventSource(applicationName, logName);
                         }
                  }
                  catch(SecurityException e)
                  {
                       string strMsg = String.Format
                                                                            (
                                                                            resourceManager.GetString("RES_DEFAULTPUBLISHER_EVENTLOG_DENIED"),
                                                                            applicationName
                                                                            );      
                                                     throw new SecurityException( strMsg, e);
                  }
            }

where applicationName and logName are string values with
applicationName = "ExceptionManagerInternalException" &
logName = "Application"

and the value of e in exception thrown is :
{
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.
   at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly)
   at System.Diagnostics.EventLog.SourceExists(String source, String machineName)
   at System.Diagnostics.EventLog.SourceExists(String source)
   at FindWhat.Enterprise.ExceptionManagement.DefaultPublisher.VerifyValidSource()
The Zone of the assembly that failed was:
MyComputer
}





Can anybody tell me how to remove this exception ?
Thanks in advance.

with Regards
Anugrah AtreyaStart Free Trial
[+][-]10.09.2006 at 11:14PM PDT, ID: 17696431

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.09.2006 at 11:14PM PDT, ID: 17696435

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.09.2006 at 11:51PM PDT, ID: 17696569

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.10.2006 at 12:18AM PDT, ID: 17696646

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2006 at 12:34AM PDT, ID: 17696691

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.10.2006 at 12:39AM PDT, ID: 17696713

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.10.2006 at 01:29AM PDT, ID: 17696892

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C# Programming Language
Tags: exception, security
Sign Up Now!
Solution Provided By: rameedev
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10.10.2006 at 01:54AM PDT, ID: 17697005

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.11.2006 at 11:55PM PDT, ID: 17713348

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 12:05AM PDT, ID: 17713369

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2006 at 12:16AM PDT, ID: 17713400

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.04.2006 at 11:49AM PST, ID: 17874239

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32