title: Microsoft.Web.Administration: System.UnauthorizedAccessException
body: <p>I use the <code>Windows.Web.Administration</code> dll in a C# program to manage IIS 7 (I use only the method <code>Recycle</code>). </p>
  
  <p>The first problem was:  </p>
  
  <pre><code>System.UnauthorizedAccessException: Filename: redirection.config
  Error: Cannot read configuration file due to insufficient permissions
  </code></pre>
  
  <p>And later I have added <code>NETWORK SERVICE</code> with full control at the folder  <code>C:\Windows\System32\inetsrv</code>".  </p>
  
  <p>Now I have this message error:</p>
  
  <pre><code>System.UnauthorizedAccessException: Access is denied. (Exception from
  HRESULT: 0x80070005 (E_ACCESSDENIED))
  at Microsoft.Web.Administration.Interop.IAppHostProperty.get_Value()
  at Microsoft.Web.Administration.ConfigurationElement.GetPropertyValue(IAppHostProperty property)
  at Microsoft.Web.Administration.ConfigurationElement.GetAttributeValue(String attributeName)
  at Microsoft.Web.Administration.ApplicationPool.get_State()
  </code></pre>
  
  <p><strong>How can I avoid this?</strong></p>