Skip to main content
 首页 » 编程设计

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

2024年02月06日14qq78292959

当我尝试从 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