Boris - you got PLAN?

"Beh-heh! Of course I got PLAN! Dey don't ever vork, but I got one!"

Well, Boris, how about this: You want to deploy a .NET usercontrol app for which you have created a COM Callable wrapper (Register for COM Interop) and you want to deploy it via a web page in Internet Explorer with the typical CAB file codebase setup and an INF file in the CAB that says what to do.

Easy, right?


NOPE! Dig this from HOW TO (Q311297):

Components That Are Required by the COM Interop Program
  • The client computer must have the Microsoft .NET runtime installed before you deploy the COM Interop assembly.

  • Developers must deploy all .NET assemblies that are included in the program.

  • Developers must deploy all Interop assemblies that represent distinct COM that are included in the program.All COM components must be deployed and registered on the client computer.


Limitations of .NET Components Deployment
  • Developers cannot install assemblies from the Web directly into the Global Assembly Cache (GAC).

  • You cannot use the OBJECT element to start any already downloaded Windows Forms controls from the GAC.

  • You cannot deploy .NET assembly and COM component in the same .cab file.

  • A single .cab file can only contain one .NET assembly.


In short, about the only sensible solution to this is to refactor your solution so that all classes and namespaces are in a SINGLE ASSEMBLY!

The reason I bring this all up is because Morgan Skinner invented a very nice way of making a .NET UserControl fool the Registry into thinking its an ActiveX control:
-- unfortunately, because of the Internet Explorer partially trusted code sandbox, and the above nasty discoveries, it just about knocks that one in the head!

There are additional issue for developers to think about as well: When a normal call is made into unmanaged code from managed .NET code, a stack walk of all assemblies is performed to make sure that all of them have permission to make calls into unmanaged code. If you have an assembly that's been downloaded from the Internet, it is not going to have such permissions by default. And, I know of no way that you can give it such permissions.

Unmanaged code aside, you will need another MSI Installer (hey, its just the 23rd CAB file and OBJECT tag - what's the big deal!) that will set Full Trust on all your dependent assemblies, based on their being signed with a strong name. Otherwise, you'll have an ActiveX control, but it will be quadriplegic.

I read it, and I wept.

Boris! Don't vorry, Dollink! Vee don't need no steenking "Dot Net"! Squirrel and Moose can do dees weeth VeeBee 6, for only $12 hour! Plus, no benefits!

Gimme a break, guys.

Comments

  1. Anonymous11:58 PM

    Hi Peter , That's a great insight on the topic , I was onto this problem a few weeks ago and sorta sumed up a similar conclusion , but your article has it all laid down real well , and it clarified my doubts and i am sure ppl over the web would find it very usefull .Though i have no experience using vb6 , gotto look into it , Weird hey u know newer technologies, which are out there to replace the old one but somethings are only feasible through old ones, Well i am off ,gotto go learn vb6 !

    ReplyDelete

Post a Comment

Popular posts from this blog

FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX

Some observations on Script Callbacks, "AJAX", "ATLAS" "AHAB" and where it's all going.

IE7 - Vista: "Internet Explorer has stopped Working"