Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
451 views
in Technique[技术] by (71.8m points)

64 bit - Office Interop with 64bit Windows in ASP.NET

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:

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {00024500-0000-0000-C000-000000000046} to the user domainusername SID (S-X-X-XX-XXX-XXXX-XXX-XXXXX). This security permission can be modified using the Component Services administrative tool.

Does anybody know what I need to change to get this working? Thanks if you can help.

EDIT - This was working fine on a 32bit server.

EDIT 2 - Nobody seems to like this but I'm not sure there's any other way given our requirements. If you can think of one, I've opened another question alternative-to-office-interop-for-document-generation

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...