C#system.io.filenotfoundexception There may be no installation on the customer's machine Officepia

Source: Internet
Author: User

Recently deploying a WinForm project that uses the Office PIA, a log file for a machine has been reported System.IO.FileNotFoundException and a number of problems have been found.

The last discovery is that the Office PIA is not deployed.

Method One: Let the customer install Office by the way. NET programmability (. NET Programmability Support)

method Two: Deploy the necessary DLL files to the program execution directory

First, after we install the Office PIA on our development machine, we want to know which DLLs we all need. Not all DLLs are what we need.
For example, in my previous example, Office PIA: Code Sample: Excelapp class for generating Excel files:
The DLLs I need actually have only these three:
Microsoft.office.interop.excel.dll
Microsoft.vbe.interop.dll
Office.dll
In Visual Studio project, add a reference to these three DLLs (that is, the three references I marked with a red line):

Then, set the Copy Local property of the three references to True:

C#system.io.filenotfoundexception There may be no installation on the customer's machine Officepia

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.