Http Compression and Assembly loading


In .Net framework 1.0 and 1.1, fusion is not able to download assemblies hosted in web servers with http compression enabled.

This is a bug in fusion, and it has been fixed in .Net framework 2.0.

We may backport the fix to 1.0 and 1.1, depending on the demand. The fix is non-trivial and affects all http assembly download case. Which means it has a high probability of regression.

Until then, please consider Deploying assemblies using cab files. It gives a much better compression ratio. And it works in all versions of .Net framework.

Comments (10)

  1. Mike Dimmick says:

    Presumably you could also turn off compression for .dll and .exe files?

    To do this in IIS 6.0 see http://www.microsoft.com/resources/documentation/IIS/6/all/techref/en-us/iisRG_PER_26.mspx.

  2. David Jones says:

    I saw a demo a while ago to do with mobile devices, GPRS and compression at MSR Asia, Beijing (by Peter Spanski). Given that the per MByte cost of GPRS transmission, compression that say is x5 or x10 is a big money saver, why isn’t http compresion a normal component of mobile devices?

  3. Mike,

    People want compression to save bandwith. They don’t want to turn off compression.

    David,

    Sorry I have no idea on mobile devices. Presumably people are concerned about CPU power and battery lifetime.

  4. Jeff Atwood says:

    > We may backport the fix to 1.0 and 1.1, depending on the demand. The fix is non-trivial and affects all http assembly download case. Which means it has a high probability of regression.

    I urge you to consider this. Example. If a Smart Client href exe app references embedded IE (AxBrowser,etc)– really quite common these days, to display HTML, etc– that incurs the 8mb (!) mshtml.dll primary interop dependency.

    This file compresses down to ~1mb!

  5. Jeff,

    Assume you install mshtml.dll’s PIA into client’s GAC, you won’t have this issue, right?

  6. Dave Russell says:

    You seem to be the expert in this field so I would really appreciate some guidance here.

    We have a series of COM+ applications written in vb.net. Each consists of a component

    which is contained in a strong-named DLL hosted in the GAC.

    I am trying to write a "simple" software distribution application which will allow us

    to maintain our development environments – having to manually configure GAC and COM+ on

    many remote machines everytime we change a DLL is a time-consuming error-prone chore.

    My application is an intranet asp.net application.

    What it needs to do is…

    1) Copy a new DLL from a "release directory" to a remote server

    2) Install that DLL into the GAC

    3) (re)Configure the COM+ application which uses the DLL.

    It does (1) and (3) quite happily.

    I’ve tried numerous different ways of doing (2) with limited success.

    If I start another process which runs pstools/psexec from the webapplication’s server to

    execute gacutil on the remote machine, it WORKS….But only if the webapplication

    is running on localhost. if the webapp is running on a server it executes GACUTIL OK,

    but GACUTIL reports an "access denied" error.

    If I make the webapplication call a webservice on the remote server and include

    your GAC-API wrapper within that webservice, I *always* get "access is denied"

    as the exception thrown from the HRESULT of the GAC Install. Even if I attach the admin

    credentials to the webservice method call and <impersonate> on the webservice itself.

    Even if the calling webapp is running on localhost.

    I think I read somewhere that to install into the GAC the code has to be running with

    FullTrust and as an Administrator. I think both of these must be true (How do I tell

    in code?) as I have given "Local Intranet" zone FULLTRUST and the webservice’s current identity is an administrator.

    As the exception is thrown by the wrapper, I can’t see what’s causing it in Fusion.dll.

    Fusion log viewer doesn’t shed any light – I don’t see any failures.

    FileMon doesn’t shed any light – I don’t see any failures.

    I’ve tried asserting permissions in case it’s something-up-the-callstack that the

    "access is denied" is failing on, but I’ve no idea what to assert, because I can’t

    see the real exception.

    Please advise what else I can do to fix this.

  7. Dave Russell says:

    (Sorry for last post. In fact, sorry for this one too !)