C# 使用Invalidate&;使功能区无效时出错;使控件无效-MS Word 2007&。Net-4.5.1

C# 使用Invalidate&;使功能区无效时出错;使控件无效-MS Word 2007&。Net-4.5.1,c#,ms-office,ribbon-control,word-2007,comaddin,C#,Ms Office,Ribbon Control,Word 2007,Comaddin,我使用的是.Net版本4.5.1 我正在创建MS Word 2007功能区控件。它是一个COMdll。在尝试使功能区或其中的任何控件无效时,我遇到以下与COM相关的错误 m_Ribbon.InvalidateControl(RibbonXTagConstants.gsClassicGroupStatus); Error: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Of

我使用的是.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版中,此语句通常工作正常。我最近将该项目升级到.NET4.5.1并开始面临这个问题。是否需要在.Net4.5.1中配置或更改任何内容。我有什么遗漏吗