C# Unable to open PPT with a WCF service

wenjie.Liu 0 Reputation points
2023-04-24T09:57:19.79+00:00

I have a problem with vsto and wcf.

I deployed the wcf service on a pc(win10 1903) to do some things with ppt document. When I log in to the computer via a remote link, wcf can open the ppt document and work normally.

However, when I exited the remote link, wcf would get stuck opening the ppt document. Please note that it is stuck and not thrown. I link the computer remotely again, and the program will continue to run. This wcf service is also used for word documents, and it works fine, but when it comes to powerpoint, the above problems occur. 123123123

I tried remote debugging using vs2015 and found that the code would get stuck on this line. I also tried to deploy the wcf on another pc(win10 20H2) and it worked fine.

I used Microsoft.Office.Interop.PowerPoint(15.0), .Net 4.5 and Office2019 plus.

Is there something wrong with my code or computer Settings?

Thanks for your answer.

code:

 PPT.Application pptApp = new PPT.Application();
            PPT.Presentation presentation = pptApp.Presentations.Open(tempFilePath + ".pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoTrue);
            foreach (PPT.Slide slide in presentation.Slides)
            {
                slide.Select();     
                // ...
            }
            presentation.Save();
            presentation.Close();

            pptApp.Quit();
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,588 questions
{count} votes