title: Can I display windows user controls inside IE8
body: <p>I have a legacy windows form application, which I would like to be displayed insider users' browsers (IE8) like a web application. An approach that I have been looking at is to create a windows form library (dll) and to show that in the browser. There are many web pages that tell me how to do this:</p>
  
  <ul>
  <li><a href="http://msdn.microsoft.com/en-us/library/a7as3z1d(v=vs.90).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/a7as3z1d(v=vs.90).aspx</a></li>
  <li><a href="http://forums.asp.net/t/1598007.aspx/1" rel="noreferrer">http://forums.asp.net/t/1598007.aspx/1</a></li>
  <li><a href="http://windowsclient.net/articles/iesourcing.aspx" rel="noreferrer">http://windowsclient.net/articles/iesourcing.aspx</a></li>
  <li><a href="https://web.archive.org/web/20210619191631/https://www.4guysfromrolla.com/articles/052604-1.aspx" rel="noreferrer">https://web.archive.org/web/20210619191631/https://www.4guysfromrolla.com/articles/052604-1.aspx</a></li>
  <li><a href="http://www.codeguru.com/csharp/.net/net_general/internet/article.php/c19639/Hosting-NET-Windows-Forms-Controls-in-IE.htm" rel="noreferrer">http://www.codeguru.com/csharp/.net/net_general/internet/article.php/c19639/Hosting-NET-Windows-Forms-Controls-in-IE.htm</a></li>
  <li><a href="http://weblogs.asp.net/spano/archive/2007/09/19/hosting-a-windows-form-control-in-a-web-page.aspx" rel="noreferrer">http://weblogs.asp.net/spano/archive/2007/09/19/hosting-a-windows-form-control-in-a-web-page.aspx</a></li>
  <li><a href="http://codebetter.com/petervanooijen/2007/06/18/including-a-winforms-user-control-in-an-asp-net-web-page/" rel="noreferrer">http://codebetter.com/petervanooijen/2007/06/18/including-a-winforms-user-control-in-an-asp-net-web-page/</a></li>
  </ul>
  
  <p>But I can't get it to work. I've made a simple windows control library, and built the DLL. I put that in the top level directory of an IIS 7.5 site, along with a html file like this:</p>
  
  <pre><code>&lt;html&gt;
     &lt;body&gt;
      &lt;object id='c' classid='http:TestWinCtrlLib.dll#TestWinCtrlLib.UserControl1' height='300' width='400'&gt;
      &lt;/object&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My browser shows a 300x400 box with a small 'picture' icon in the top left.
  At first, IIS refused to serve the .dll file giving 403.2 and 401.2 errors, but now I've set the IIS persmission properties correctly, the logs indicate that it is being served successfully.</p>
  
  <pre><code>2012-05-01 01:28:50 ::1 GET /form.html - 8008 - ::1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 200 0 0 1
  2012-05-01 01:28:50 ::1 GET /TestWinCtrlLib.dll - 8008 - ::1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 200 0 0 23
  </code></pre>
  
  <p>I can't even tell what is going wrong. The first link above has a section on error reporting, and I've added these keys to the registry, but I don't see any errors. I tried starting iexplore from a cmd prompt, in case errors might show up on the standard output, but nothing.</p>
  
  <blockquote>
    <p>Error Reporting</p>
    
    <p>The code download process uses the following two registry settings to
    control error reporting from managed code executables that are
    deployed using Internet Explorer.</p>
    
    <ul>
    <li>HKLM\Software\Microsoft.NETFramework\ExposeExceptionsInCOM</li>
    <li>HKCU\Software\Microsoft.NETFramework\ExposeExceptionsInCOM</li>
    </ul>
    
    <p>...</p>
    
    <p>When you debug managed code that you deploy using Internet Explorer, you can use the values of these settings to find detailed information about code download failures. For example, this allows you to view stack trace information when exceptions are thrown, instead of relying on the error-reporting provided by Internet Explorer, which was designed for end-users, not developers.</p>
  </blockquote>
  
  <p>Is it possible that this functionality is no longer supported? Most of the references I found seem to be 2007-2010. Perhaps <a href="http://msdn.microsoft.com/en-us/library/31kztyey.aspx" rel="noreferrer">ClickOnce</a> is the only way to do this now. I can get that to work, but the code runs in its own window, not inside the browser.</p>
  
  <p>I've tried compiling the library using .Net frameworks 3.5 Client Profile and 4.0 Client Profile. But they seem to give the same result.</p>
  
  <p>Any help welcome - thanks.</p>