当我尝试从 Delphi 应用程序加载 COM 可见的 C#.net 程序集时,Windows Server 2012 上会弹出“该类未配置为支持提升激活”错误。
有没有办法将其配置为以编程方式支持提升激活?
目前为了避免,权限级别设置为“以管理员身份运行”。
最佳答案
这是 CO_E_ELEVATION_DISABLED
错误。如果该类未在注册表中正确注册提升,则可能会发生这种情况。您可以在MSDN中找到如何注册它:
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.
此博文中有更多信息:
关于c# - 该类未配置为支持提升激活,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28762126/