我有一个 ActiveX 控件,并已使用测试证书对其进行签名,一切正常,但问题是我的 Internet Explorer 显示了一条丑陋的消息
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....
为什么控件名称不可用?我在 C# 中制作了这个 ActiveX 控件,并将 ComVisible 属性添加到我的 assemblyInfo.cs 中,这是代码
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 控件必须签名,信息带从签名中获取该信息。 This article真的很老(1996 年),但应该让你朝着正确的方向前进。
编辑:
您可以在安装过程中将您的控件添加到预先批准的列表中,请参阅 document .
还要确保注册一个合适的 ProgID .
编辑2:
实际上,通过一些阅读,托管扩展似乎总是加载运行时,因此 IE 将其视为运行时。 Active X 可能是同样的问题。
关于c# - 如何设置 ActiveX 控件名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1783209/