I created a OData ADO.NET Framework web api which I am testing in localhost and am getting the error
Line 19: if (!EventLog.SourceExists("MyService"))
The StackTrace is:
[SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.]
System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) +657
System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) +104
System.Diagnostics.EventLog.SourceExists(String source) +14
How should I remove this error ? Thanks a lot.
My web.config has:
<system.web>
<authentication mode="Windows">
<forms requireSSL="true" />
</authentication>
<authorization>
<allow roles="MyService" />
<deny users="*" />
</authorization>
<httpCookies requireSSL="true" httpOnlyCookies="true" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" enableVersionHeader="false"/>
</system.web>