views:

895

answers:

2

What are the steps to deploying a project created in VS2008 (windows forms and c#) as a ActiveX control hosted in ie? I have a file uploader project that I want to be hosted on a webpage that users can navigate to, click 'trust this active x control' and the application runs on the page in the browser, just like a java application.

To be clear, I'm not looking for ClickOnce (that is an installer) and I don't want the user to have to modify their .Net security or add a trusted site (so just putting the .dll file in a OBJECT tag doesn't work). Do I need some digital signature, some certificate something? I've found references to this but no step-by-step guide to it (like I got for java).

Any suggestions? This seemed like it'd be the easiest part of the project but its turning out to be by far the hardest, I can't make any headway on it.

Thanks, Sam

+1  A: 

We deploy AX control in two forms:

  1. CAB file. Installation process as you described in question. You need sign control, pack it into CAB and sign the CAB file. More details you can find here: Packaging ActiveX Controls.

  2. Standalone installer. MSI file for users without admin privileges for manual installation.

Eugene
+1  A: 

And the answer is, sadly, that .net "activeX controls" aren't like COM activeX controls (VB6), even if you make the .net control com-visible you can't register it with the OS the same way. What you have to do is:

1) Create your .net dll file 2) Create an installer exe (I did it with InstallShield, looks like it can also be done in VS) 3) Package that installer into a cab file 4) Point to that cab file in IE.

What this results in is in IE the little 'activeX' confirm drops down, then the 'do you trust this app' comes up, then UAC (vista/w7) and then you get to run through the normal application install process: installer window comes up, confirm, pick install dir. After thats done, your control appears on the page in IE.

The way it used to work in COM was once you did the little activeX confirm drop down (and UAC) the app would just run

Now, the above is only if you need/want it to be .Net 2.0 compatible. If you don't mind only being compatible with 3.0 or higher you can do an XBAP application:

http://stackoverflow.com/questions/1309451/what-is-microsofts-roadmap-for-in-browser-applications-silverlight-clickonce

And you can even just take your .Net dll you spent the last 3 weeks learning how to make (frick) and jam it into the WPF application:

http://stackoverflow.com/questions/1310154/how-to-put-a-custom-windows-forms-control-in-a-wpf-application

Hope this helps others. Sam

Shizam