Interop.word service

Asked

Viewed 145 times

-5

Good afternoon, I am using microsoft.office.Interop.word to convert word documents into pdf in WCF, however the interface simply to work WCF is online only the interface does not work, where it is necessary to restart the WCF service to get it back up and running.

Does anyone have any idea what it might be?

  • But do you have a mistake? "It doesn’t work" which means?

  • It means that the service is online but the Interop does not work the routine that Convert word to pdf through the Interop, does not return error and when left wcf works again.

  • To help it would be interesting for you to post what you are trying to do and which error message occurs. There may be hundreds of reasons.

  • And the code from where you are using the Interop? Improve this explanation there, otherwise it is difficult right!

1 answer

0

Maybe it may be a conflict of the site version, using Interop you should run your application as 32bits. Configure in the IIS application pool to run the application as 32 bits. The server must have installed the office version you are using Interop as well.

After using Interop, you must release the object.

try
{
    System.Runtime.InteropServices.Marshal.ReleaseComObject(msWordDoc);
    msWordDoc = null;
}

catch (Exception exReleaseObject)
{
    msWordDoc = null;
    //   Console.WriteLine(CMSResourceFile.REALESE_FAILED+ exReleaseObject);

}
finally
{
    GC.Collect();
    GC.WaitForPendingFinalizers();
    GC.Collect();
    GC.WaitForPendingFinalizers();
}

Maybe that answer will help you.

https://stackoverflow.com/questions/44544295/keeping-one-interop-office-application-alive-until-iis-restart-for-all-users-i

  • Then web application calls a WCF service that is responsible for Interop.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.