我在 .Net 版本 4.5.1 上。
我正在创建一个 MS Word 2007 功能区控件。这是一个COM
dll
。在尝试使功能区或其中的任何控件无效时,我收到以下与 COM 相关的错误...
m_Ribbon.InvalidateControl(RibbonXTagConstants.gsClassicGroupStatus);
Error:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.IRibbonUI'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000C03A7-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
请注意,在 .Net 版本 3.5 中,此语句曾经可以正常工作。我最近将项目升级到 .Net 4.5.1 并开始面临这个问题。我需要在 .Net4.5.1 中配置或更改什么吗?有什么我想念的吗?