开发者

Word Component in C#

I am using component of Microsoft.Office.Interop.Word.dll on C#.But when i run it on IIS,I am receiving the following error.

Retrieving the COM class factory for component with 
CLSID {000209FF-0000-0000-C000-000000000046} failed 
due to the following error: 80070005.

if I allow 32-bit applications on IIS,I am receiving the following error.

”Validation of viewstate MAC failed. If this application is 
hosted by a Web Farm or cluster, 
ensure that <machineKey> configuration specifies the 
same validationKey and validation algorithm.
AutoGenerate cannot be used in a cluster”

I am entering the following line into web.config file.

<system.windows.forms jitDebugging="true"/>  

if I run again , that's gives me error.

Microsoft Word encountered a problem.

Description: An unhandled exception occurred during the execution
of the current web    request. Please review the 
stack trace for more information about the error and 
开发者_如何转开发where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: 
Word encountered a problem.

Source Error:

Line 711:
Line 712:        //ADDING A NEW DOCUMENT TO THE APPLICATION
Line 713:        oWordDoc = oWord.Documents.Add(ref yol, ref oMissing, 
ref oFalse, ref   oTrue);
Line 714:
Line 715:        // SELECT END

By the way, I am using IIS 7 64-bit on Windows Server 2008.

How can i solve this problem?

Thanks in advance.


Error (or HRESULT) 0x80070005 translates to E_ACCESSDENIED which means you've got a permissions problem somewhere.

Make sure your web site's identity has permissions to access Word.

Also make sure your application pool's enable32BitOppOnWin64 setting is configured to match whatever processor architecture your Word app is targeted at.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜