none
Visual Studio 2015 web site solution Microsoft Office Interop Word 15.0 RRS feed

  • Question

  • I have a old web site solution from VS2005 whose folder structure is not modified but code is changed in VS2015.

    No complaints about any problems from VS version difference.

    I have code that reads a MS Word Doc and does some process to the doc and saves.

    I have used Microsoft.office.interop.word.dll. The solution is working fine in local but failing from Window Server 2012 when deployed to domain in IIS.

    I was getting Error "could not load file or assembly office interop version=15.0.0.0..........

    I have seen people suggesting 1. to install MS Office on to server. I did that

    I was getting different error.

    It is giving regdb error. I have made changes to dcomcnfg as per some suggestion of similar problems.

    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))

    SOme body has suggested in stackoverflow, to replace Microsoft.office.interop.word.dll with COM Object Microsoft.object library which installed "interop.microsoft.office.core.dll which is working as similar as above one.

    But it has not resolved the regdb error.

    Can somebody throw some light here to show me a solution?


    Ekambar Rao

    Monday, March 20, 2017 3:37 PM

All replies

  • Hi,

    >>The solution is working fine in local but failing from Window Server 2012 when deployed to domain in IIS.

    Please visit Considerations for server-side Automation of Office:

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    I suggest you use Open XML Library instead of Microsoft.Interop dll.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 21, 2017 2:17 AM
    Moderator
  • Hello Ekambar,

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.

    You may consider using Open XML SDK if you deal only with open XML documents, see Welcome to the Open XML SDK 2.5 for Office for more information. Or any third-party components designed for the server-side execution.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, March 21, 2017 10:29 AM