c# - 该类未配置为支持提升激活

标签 c# delphi

当我尝试从 Delphi 应用程序加载 COM 可见的 C#.net 程序集时,Windows Server 2012 上会弹出“该类未配置为支持提升激活”错误。

有没有办法将其配置为以编程方式支持提升激活?

目前为了避免,权限级别设置为“以管理员身份运行”。

最佳答案

这是 CO_E_ELEVATION_DISABLED 错误。如果该类未在注册表中正确注册提升,则可能会发生这种情况。您可以在MSDN中找到如何注册它:

The COM Elevation Moniker

The COM class must also be annotated as LUA-Enabled. This requires the following registry entry:

HKEY_LOCAL_MACHINE\Software\Classes\CLSID
  {CLSID}
    Elevation
      Enabled = 1

If this entry is missing, then the activation returns the error CO_E_ELEVATION_DISABLED.

Note that these entries must exist in the HKEY_LOCAL_MACHINE hive, not the HKEY_CURRENT_USER or HKEY_USERS hive. This prevents users from elevating COM classes that they did not also have the privileges to register.

此博文中有更多信息:

Local elevation points in Windows and Delphi

关于c# - 该类未配置为支持提升激活,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28762126/

相关文章:

c# - 管理托管 (C#) 和非托管 (C++) 对象的析构函数

c# - 无法将类型 'System.Collections.Generic.List<String>' 隐式转换为 'System.Collections.Generic.IEnumerable<turon.Model.Products_Products>

function - Delphi:平滑折叠/展开形式

delphi - 使用 BDE 和 Delphi 访问 dBase 文件的好方法是什么?

delphi - 如何确定与 Indy 的连接是否仍然存在?

c# - 如何识别一个字符串是否包含多个特定字符的实例?

c# - smtp - 每封邮件都有超时

c# - 使用WCF按照行业标准实现服务?

delphi - 如何打开麦克风?

delphi - 从 TWebBrowser 获取 Cookie