Uncategorized

Http compression and WinForm controls as legacy ActiveX

The following is the summary of a couple of cases I worked on a while ago, there are some details which I’ll need to investigate thoroughly… anyway those are the facts so far.

PROBLEM DESCRIPTION
===================
I have a rich WinForms UserControl which is embedded into a web page. Since installing .NET 2.0 on the clients, the control stopped loading completely.
– I disabled security completely using caspol -s off => no effect
– I enabled fusion logging => no single entry generated
– I enabled the IEHost log => nothing created
– Changed to another client machine => same issues, same results
– I started writing a new UserControl from scratch and deployed it to the same server. The control could also not be loaded.

I deployed the same test project to another 2003 server in the same domain, with equal patch levels (SP1 and latest patches installed) and it worked. Perhaps a naming issue?
– I tried to change the names => no result
– I compared the HTTP requests to the different server => nothing special

– The issues stated above are reproducible from any client, such it should be a server or framework issue.
– I even have a customer which experienced the same problems
– The problem exists for two completely different client applications

To again clarify my problem:
—————————-
– I’m definitely sure that I’m using the 2.0 tools and not the 1.1 policy / binding / whatever tools.
– I’m sure it is not a security issue, at least not one of the caspol which I disabled completely using “caspol -s off”
– I’m sure the control gets downloaded by the browser into the temporary IE directories and I’m sure that the downloaded version matches the dll’s I deployed onto the server
– Windows Firewall is completely disabled through Group Policy
– Virus Scanner has been temporarily turned off, on both client and server
– I’m sure that the problem is not dependant on the control code itself It just doesn’t load into the IEHost which I could conclude from none of the logs, neither IEHost-log nor binding-log are being created at all.

My remaining and only problem is why does it not load from that specific server. It must be something within the communication and not the control itself. Last update: I currently did a network trace and found one significant difference between the two servers: one is doing chunked HTTP response encoding, the other one not. I disabled my browser doing HTTP 1.1 and the control loads (HTTP 1.0 does not allow chunked encoding!).

 

SUMMARY of TROUBLESHOOTING
==========================
This is a known problem with Windows Forms controls embedded in Internet Explorer, along with HTTP compression enabled on the web server, and has nothing to do with the installation of .NET Framework 2.0 (the same issues applies also for version 1.1).  The second test server, where the application worked fine, was not configured to use http compression.

Troubleshooting the problem I found that the dll is downloaded in IE temporary folder with the name specified in ClassID (SimpleControl.dll#SimpleControl.UserControl1), and it does not show up using “gacutil /ldl” if I disable http compression (I tired “Compress static files” with and without “Compress applications files” with no difference), SimpleControl.dll is downloaded in IE temporary folder it also shows up with gacutil.
A second workaround is to package your assembly into a CAB file (like we used to do with ActiveX controls before the .NET arrival): you can find further reference on how to create and deploy a CAB file at
Walkthrough: Creating a CAB file.

To check if you are using http compression in IIS 6.0, do the following (Enabling HTTP Compression):

  1. In IIS console double click the local computer, right click the Web Sites folder and the click Properties
  2. Click the Service tab, and in the HTTP Compression section select the Compress application files checkbox to enable compression for dynamic files
  3. Select the Compress static files checkbox to enable compression for static files

 

Cheers
Carlo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.