How do you deploy an ActiveX control for ie from a VS2008 project?

白昼怎懂夜的黑 提交于 2019-12-23 03:44:25

问题


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:


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.




回答2:


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:

What is Microsoft's roadmap for in browser applications? Silverlight, ClickOnce, ActiveX, dlls

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:

How to put a custom windows forms control in a WPF application?

Hope this helps others. Sam



来源:https://stackoverflow.com/questions/1301713/how-do-you-deploy-an-activex-control-for-ie-from-a-vs2008-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!