c# - 如何设置 ActiveX 控件名称

标签 c# .net internet-explorer activex

我有一个 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/

相关文章:

html - 高度 :100% not working in Internet Explorer

c# - 关于regex的疑问

c# - 在 Windows 窗体中更改 ComboBox 边框颜色

c# - 剧作家 "Element is not attached to the DOM"

c# - Azure 函数 - 队列触发器将 DateTimeOffset 返回为 null

internet-explorer - ie8,9 中的 css 选择器问题

javascript - 跨浏览器(包括IE)绕中心旋转SVG图形

c# - CrossGeolocator 的 GetPositionAsync 不起作用

c# - 为什么 SqlParametersCollection 每次都要求参数名称开头为 "@"?

.net - 如何将文件从 ASP.NET 复制到存在权限问题的 Linux 服务器?