Office Interop with 64bit Windows in ASP.NET

前端 未结 5 1760
广开言路
广开言路 2020-12-17 08:11

I\'m trying to do office 2003 interop using C# ASP.NET on a server running Windows 2003 64 bit (I\'m running IIS in 32bit mode though) and getting error messages like:

5条回答
  •  眼角桃花
    2020-12-17 08:52

    None of the Office applications work properly when called from a server environment. Their COM interfaces are meant for desktop automation, not automation from a server application. Anything you do to try to make them work will involve hacks built upon hacks, and is doomed to failure.

    This leaves aside the fact that you are not licensed to run them from a server application.


    Correction: The KB article Considerations for server-side Automation of Office does indeed say that you are licensed for server-side automation of Office products for use only if the clients are all licensed:

    Besides the technical problems, you must also consider licensing issues. Current licensing guidelines prevent Office applications from being used on a server to service client requests, unless those clients themselves have licensed copies of Office. Using server-side Automation to provide Office functionality to unlicensed workstations is not covered by the End User License Agreement (EULA).

    On the other hand, that KB article lists a large number of reasons to never do this. They include:

    • User Identity
    • Interactivity with the desktop
    • Reentrancy and scalability
    • Resiliency and stability
    • Server-side security

    I recommend this KB article to anyone considering server-side automation of Office products.

提交回复
热议问题