如何为VS2008项目部署一个ActiveX控件? [英] How do you deploy an ActiveX control for ie from a VS2008 project?

查看:251
本文介绍了如何为VS2008项目部署一个ActiveX控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将在VS2008(windows窗体和c#)中创建的项目部署为在ie中托管的ActiveX控件的步骤是什么?我有一个文件上传工程,我想在一个网页上托管用户可以导航到,点击信任这个活动的X控件,应用程序运行在浏览器的页面,就像一个java应用程序。

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.

要清楚,我不是在寻找ClickOnce(这是一个安装程序),我不想让用户必须修改他们的.Net安全或添加一个受信任的站点所以只是将.dll文件放在OBJECT标签中不起作用)。我需要一些数字签名,一些证书的东西吗?我找到了这个参考,但没有一步一步的指南(像我得到的java)。

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.

谢谢,
Sam

Thanks, Sam

推荐答案

答案是,可惜的是.netactiveX控件不像COM activeX控件(VB6),即使你使.net控件可见,你不能以相同的方式注册它与操作系统。你需要做的是:

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)创建.net dll文件
2)创建一个安装程序exe(我用InstallShield,看起来像也可以在VS中完成)
3)将安装程序打包到cab文件
4)指向IE中的那个cab文件。

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.

这导致在IE的小'activeX'确认下降,然后'你信任这个应用程序'出来,然后UAC(vista / w7)和然后你运行通过正常应用程序安装过程:安装程序窗口出现,确认,选择安装目录。

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.

它在COM中工作的方式是一旦你做了一个小的activeX确认下拉(和UAC)该应用程序只会运行

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

现在,上面的只是如果你需要/想要它是.Net 2.0兼容。如果你不介意只与3.0或更高版本兼容,你可以做一个XBAP应用程序:

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

你甚至可以拿你的.Net dll你花了最后3个星期学习如何使将其插入WPF应用程序:

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:

如何在WPF应用程序中放置自定义窗体控件?

希望这有助于其他人。
Sam

Hope this helps others. Sam

这篇关于如何为VS2008项目部署一个ActiveX控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆