title: Using different versions of MSHTML in C#
body: <p>Is there any way to force a C# application to use a specific version of the MSHTML DLL?</p>
  
  <p>I'm trying to write an application that uses the different versions of the IE rendering engine to help web designers test their creations for backwards compatibility with IE6, IE7 etc...</p>
  
  <p>As far as I understand so far, the SHDOCVW DLL 'hosts' or 'runs' the MSHTML DLL (<a href="http://msdn.microsoft.com/en-us/library/aa741313(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa741313(VS.85).aspx</a>).</p>
  
  <p>I have been able to create a Microsoft Web Browser (COM Component version 1.1) on the application form by dragging the version 6.0.2900.2877 SHDOCVW.DLL onto the Toolbox in Visual C# 2008 Express Edition as well as create a standard WebBrowser .NET component in the hope that the COM Component would use v6 of MSHTML (located in the same folder as the v6 SHDOCVW DLL)... however both components seem to use the same (perhaps the system?) version of MSHTML.</p>
  
  <p>I've run the app in XP SP2 with IE6 and XP SP3 with IE7.</p>
  
  <p>In SP2 with IE6 both browser components report <code>$_SERVER['HTTP_USER_AGENT']</code> as MSIE 6.0 and in SP3 with IE7 both browser components report <code>$_SERVER['HTTP_USER_AGENT']</code> as MSIE 7.0.</p>
  
  <p>Does anyone know if it is possible to force use of a particular version of the MSHTML DLL? And if so, how?</p>