如何设置ActiveX控件名称

我有一个ActiveX控件,并且已经使用测试证书对其进行了签名,但每个工作正常但问题是我的Internet Explorer显示了一条丑陋的消息

该网站希望运行以下附加组件:“控制名称不可用”中的“不可用”,如果您信任该网站和加载项并希望允许其运行,请单击此处….

为什么控件名称不可用? 我在C#中创建了这个ActiveX控件,并在我的assemblyInfo.cs中添加了ComVisible属性,这里是代码

using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using System.Runtime.InteropServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: System.Runtime.InteropServices.ComVisible(true)] [assembly: AssemblyTitle("My ActiveX Control")] [assembly: AssemblyDescription("My ActiveX Control Description")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CompanyXYZ")] [assembly: AssemblyProduct("My ActiveX Control")] [assembly: AssemblyCopyright("2009")] [assembly: AssemblyTrademark("CompanyXYZ")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.1")] 

请帮帮我?

你签署了控制权吗? 必须对Active X控件进行签名,并且信息带从签名中获取该信息。 这篇文章真的很古老(1996),但应该让你朝着正确的方向前进。

编辑:

您可以将控件添加到预先批准的列表作为安装的一部分,请参阅此文档 。

还要确保注册适当的ProgID 。

Edits2:

实际上,从进行一些阅读看来,托管扩展似乎总是加载运行时,因此IE将其视为运行时。 可能是Active X的同样问题。

诀窍是你不仅需要签署ActiveX .cab文件,还需要签署它包含的.dll和.ocx文件。 看到这里

我可能错了,但如果我没记错的话,COM名称与常规程序集属性是分开的。 一旦我在vb.net中编写了activex并且能够正确地看到描述和标题。