Cocould not load file or assembly 'Microsoft. Office. InterOP. Excel, version = 11.0.0.0, culture = neutral, publickeytoken = 71e9bce111e9429c' or one of its dependencies.
There are two reasons for this problem:
1. "Excel 2003" is not installed in the system ";
2. "Excel 2003" is installed in the system, but it is not installed in GAC. (About GAC globalProgramFor details about the set cache, refer to the msdn help .)
First of all, if the problem occurs due to the first reason, it is best to solve the problem, that is, install Microsoft Excel 2003.
In addition, it is caused by the second reason. There may also be two possible causes: one is to install in the office.. NET Framework is installed before, and the other is missing the ".. Net programmable support ". Now we need to install Office 2003 PIA (Master InterOP assembly) into GAC. The installation method and steps are as follows:
1) if the. NET Framework is not installed on the system, install it first. If it is already installed, perform step 2.
2) perform the "change" installation operation on the office in "add or delete programs" and reinstall the missing installation. The procedure is as follows:
For example, add or delete an office
For example, advanced user-defined applications
For example, select "run from local" or "Run all programs from local" from the drop-down menu of the ". Net programmable support" option ".
After the above steps, Office 2003 Pia will be installed in GAC. You can see from the following directory: "C: \ WINDOWS \ assembly ", as a result, the problem described in the question is solved.
Similarly, you can refer to this method to reference other assembly in Asp.net for similar issues.
ArticleFrom: hongshi Internet (http://www.hungstone.cn /)