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(ap
plicationN
ame))
{
--------------------------
----->>> EventLog.CreateEventSource
(applicati
onName, logName);
}
}
catch(SecurityException e)
{
string strMsg = String.Format
(
resourceManager.GetString(
"RES_DEFAU
LTPUBLISHE
R_EVENTLOG
_DENIED"),
applicationName
);
throw new SecurityException( strMsg, e);
}
}
where applicationName and logName are string values with
applicationName = "ExceptionManagerInternalE
xception" &
logName = "Application"
and the value of e in exception thrown is :
{
System.Security.SecurityEx
ception: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
at System.Diagnostics.EventLo
g.FindSour
ceRegistra
tion(Strin
g source, String machineName, Boolean readOnly)
at System.Diagnostics.EventLo
g.SourceEx
ists(Strin
g source, String machineName)
at System.Diagnostics.EventLo
g.SourceEx
ists(Strin
g source)
at FindWhat.Enterprise.Except
ionManagem
ent.Defaul
tPublisher
.VerifyVal
idSource()
The Zone of the assembly that failed was:
MyComputer
}
Can anybody tell me how to remove this exception ?
Thanks in advance.
with Regards
Anugrah Atreya
Start Free Trial