问题
I am trying to access the Word Office Interop on a server from my aplication using the following line:
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
This however causes an exception to be throw:
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
Does anyone know what I can do to allow my program to access this?
回答1:
You need to grant permission to 'Launch and Activate' for the user running IIS.
Start-->Run-->dcomcnfg
Under Component Services\Computers Right-Click 'My Computer'
Permissions are under COM Security
来源:https://stackoverflow.com/questions/7558076/office-interop-issue-on-windows-server