How to Set ActiveX Control Name

2020-04-03 13:04发布

I have an ActiveX control and have signed it with a test certificate every this is working fine but problem is that My internet explorer shows an ugly message

The website wants to run following add-on: 'Not Available' from 'Control name is not available', If you trust the website and the add-on and want to allow it to run, click here....

Why the control name is not available? I have made this ActiveX control in C# and have added the attribute ComVisible to my assemblyInfo.cs, here is the code

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")]

Please help me out?

3条回答
Lonely孤独者°
2楼-- · 2020-04-03 13:33

Hi the trick is you need to sign not only the ActiveX .cab file but also the .dll and .ocx files it contains. see here

查看更多
爷、活的狠高调
3楼-- · 2020-04-03 13:35

I might be wrong but if I recall correctly, COM names are separate from regular assembly attributes. Once I have written an activex in vb.net and was able to see description and title correctly.

查看更多
Deceive 欺骗
4楼-- · 2020-04-03 13:38

Are you signing your control? Active X controls must be signed, and the Information Band gets that information from the signature. This article is really old (1996), but should get you going in the right direction.

Edits:

You could add your control the pre-approved list as part of your install, see this document.

Also make sure register an appropriate ProgID.

Edits2:

Actually, from doing some reading it seems that managed extensions always load the runtime, so IE sees it as the runtime. Could be the same problem with Active X.

查看更多
登录 后发表回答