Exception Details: System.Security.SecurityException: The source was not found, but some or all even

Posted by SheoNarayan under Error and Solution on 3/19/2011 | Points: 10 | Views : 13789 | Status : [Administrator] | Replies : 1

If you are getting following error at the time of development, you need to open Visual Studio as an administrator (right click the VS icon and select Run at Adminsitraot).

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security. 


In case you are getting this error in the live, you need to make sure that the Network Services have the permission to write the Event log.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com



Responses

Posted by: Postalmike on: 3/16/2013 [Member] Starter | Points: 25

Up
0
Down
I am using Windows 8 Home edition -- all seems to be running fine but ... I tried the solution by adding the Network Service to the Event Log in the Registry. Gave network service full control, applied changes.
Tried to browse, same error. Opened a new Firefox window to make sure cache was not an issue, same error.
Restarted IIS and the Website, same error.

One post recommends adding ASPNET user to the Security entry below Event Log in the Registry. There is no such user in Windows 8. However, ASPNET trust levels apparently are set directly in IIS now and the app needs to be running under its own pool. The site is running under its own pool, trust level is Full(Internal) by default.

I can browse to the site and log in. It was set for SSL Enforced/Enabled on the server where it lives. I can't develop on the server so I restored the site/db locally. I can browse to the site and log in. It is after log in that get the error.

I'm running Windows 8 Home, Toshiba L875D computer, IIS 8, 6GB RAM, VS 2010 Pro, site installed is Dot Net Nuke 5.x. I'm logging in as admin -- the host user never supplies his credentials nor sets up host level access.

On a whim, I'm going to look up the sproc for getting the host credentials from SSMS and try to log in as host.

Any ideas on what would be a solution here?

Thanks,

PM.

Here is the exception:

Server Error in '/' Application.Security Exception
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.

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.] System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) +810 System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) +315 System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName) +124 System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +356 System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +197 System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) +30 RealDropzone.Exceptions.WriteToEventLog(String strMessage, String strSource) +527


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response