title: Cannot write to the Event log
body: <p>edI have C# ASP.NET 4.5 Webform application and use the following code:</p>
  
  <pre><code> if (!EventLog.SourceExists(sSource)) EventLog.CreateEventSource(sSource, sLog);
  
       EventLog.WriteEntry(sSource, message, level);
  </code></pre>
  
  <p>Since the first line was failing I created 
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\IDDISLOG in registry</p>
  
  <p>I get the following exception on WriteEntry Method:</p>
  
  <pre><code> Cannot open log for source 'IDDISLOG'. You may not have write access. 
  </code></pre>
  
  <p>Searched other similar questions but none worked for me.</p>
  
  <p>Here is what I have done so far: </p>
  
  <p>Added "Network service" to the project file folder</p>
  
  <p>Added <code>Network service</code> to and gave it full access.
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog</p>
  
  <p>Added Nertwork service to and gave it full access.</p>
  
  <pre><code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Security
  </code></pre>
  
  <p>Checked and saw w3wp.exe *32 process runs with User Name ASP.Net v4.0.</p>
  
  <p>So added ASP.Net v4.0 to </p>
  
  <pre><code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog
  </code></pre>
  
  <p>Still, error remains</p>