我正在构建SharePoint自动托管应用程序。因为我使用了Microsoft.Office.Interop.Word动态链接库。我已将app发布到Office-365环境。当我的代码到达我初始化互操作对象的地方时,它会抛出这个错误。
行:
Microsoft.Office.Interop.Word.Application ap = new Microsoft.Office.Interop.Word.Application();我得到的错误是:
Error in Default page: System.Runtime.InteropServices.COMException(0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at DocumentAppTestWeb.Pages.Default.Page_Load(Object sender, EventArgs e)当我通过按F5来运行我的应用程序时,它运行得很好。
但是,当我将我的.app文件发布到Office365环境的应用程序目录时,它给出了上述错误。
有什么我可以使用的选项吗?任何帮助都将不胜感激!
发布于 2014-03-20 16:17:22
我很确定这是你电脑上的一个本地问题!:) Interop连接到在计算机程序或程序集(支持COM)上找到的功能。
Installing and Using the Office 2003 Primary Interop Assemblies (这是较旧版本的office,但过程大致相同。)请确保您已正确安装:)
https://stackoverflow.com/questions/22526813
复制相似问题