gpt4 book ai didi

visual-studio - Visual Studio - TYPE_E_REGISTRYACCESS

转载 作者:行者123 更新时间:2023-11-30 17:12:15 27 4
gpt4 key购买 nike

我正在构建我的 Visual Studio 解决方案,但在输出窗口中只有一个项目出现错误。

在错误选项卡中:

Error   161 Cannot register type library "D:\Sites\Website\MyPortal.Website.Controllers\bin\Debug\MyPortal.Website.Controllers.tlb". Error accessing the OLE registry. (Exception from HRESULT: 0x8002801C (TYPE_E_REGISTRYACCESS)) MyPortal.Website.Controllers

在输出选项卡中:

Compile complete -- 0 errors, 153 warnings
MyPortal.Website.Controllers -> D:\Sites\Website\MyPortal.Website.Controllers\bin\Debug\MyPortal.Website.Controllers.dll
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3341,9): warning MSB3214: "D:\Sites\Website\MyPortal.Website.Controllers\bin\Debug\MyPortal.Website.Controllers.dll" does not contain any types that can be registered for COM Interop.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3341,9): error MSB3213: Cannot register type library "D:\Sites\Website\MyPortal.Website.Controllers\bin\Debug\MyPortal.Website.Controllers.tlb". Error accessing the OLE registry. (Exception from HRESULT: 0x8002801C (TYPE_E_REGISTRYACCESS))
========== Rebuild All: 8 succeeded, 1 failed, 0 skipped ==========

有什么想法吗?

最佳答案

设置Register For Com interop我发现您确实需要以管理员身份运行。

在没有管理员尝试编译的情况下,我遇到了如下错误:

Cannot register assembly "C:\TFS\Project\Src\ProjectAddin\bin\Debug\ProjectAddin.dll" - access denied. Please make sure you're runningthe application as administrator. Access to the registry key'HKEY_CLASSES_ROOT\CLSID{3A6192EA-3C9C-39EB-99A3-3DBFF8CA118F}' isdenied.

上面的注册表项不存在,所以我创建了它,然后尝试编译我得到:

Cannot register type library"C:\TFS\Project\Src\ProjectAddin\bin\Debug \ProjectAddin.tlb". Erroraccessing the OLE registry. (Exception from HRESULT: 0x8002801C(TYPE_E_REGISTRYACCESS))

解决方案

关闭 Register for COM interop 错误消失,或者更好的解决方案:

Shift + 右键单击​​ Visual Studio 并以管理员身份打开,打开项目。勾选 Register for Com interop,编译成功。

关于visual-studio - Visual Studio - TYPE_E_REGISTRYACCESS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10875278/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com