title: Determining if ASP.Net is properly registered
body: <p>Does anyone have a bulletproof method (in C# ideally!) of determining if ASP.Net is properly registered on your computer ?</p>
  
  <p>I am writing an installation program for an ASP.Net application and I need to know whether I should run <code>aspnet_regiis</code>.  </p>
  
  <p>At the moment we always run <code>aspnet_regiis</code> - I to ensure that ASP.Net is registered properly but this undesirable because it prompts a restart of all the application pools.  </p>
  
  <p>There are several useful pages on the web (e.g. <a href="http://www.codeproject.com/KB/cs/iisdetection.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/iisdetection.aspx</a>) but as the comments in that post show, it is quite often the case that the registry reports that ASP.Net is registered but <code>aspnet_regiis</code> still needs to be run to configure IIS.  The user 'JonB' posted something that looks like it should work for IIS6 (and IIS7 with IIS6 compatibility enabled) but I would still need to write separate detection code for IIS 7 with IIS6 compatibility mode disabled.</p>
  
  <p>So has anyone cracked this nut already?  If so please let us know as it will be a time saver.  Otherwise I will try and port the C++ solution into C# for IIS6 and for IIS7 I will look examine the <code>&lt;isapiCgiRestriction&gt;</code> section of <code>applicationHosts.config</code> for </p>
  
  <pre><code>&lt;add path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" /&gt;
  </code></pre>
  
  <p>Last question...</p>
  
  <p>Does anyone know if things are the same/different in Windows 7?</p>