I have a problem while I put my site on server... I have a code for upload a excel file data to sql database.. so I put this assembley in my web config file
<add assembly="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
After publishing my site working on local IIS.. After puting it on server it gives follwoing error
Server Error in '/ems' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
|
Source File: C:\domains\poojahostingbiz\ankit.poojahosting.biz\wwwroot\ems\web.config Line: 48
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' could not be loaded.
|
上述问题的解决方法有两种: 第一种:
1)、如果系统未安装.Net Framework,请先安装,如果已安装了的话就可直接进行第二步。
2)、在“添加或删除程序”中对Office进行“更改”安装操作,将漏装部分重新安装上去即可。具体操作如下面的图片:
如下图:添加或删除Office功能

如下图:对应用程序进行高级自定义
如下图:在“.Net 可编程性支持”选项的下拉菜单中选择“从本机运行”或“从本机运行全部程序”。
经过以上步骤的安装后,Office 2003 PIA就会被安装到GAC里去了,可以从以下目录看到:“C:\Windows\assembly”,从而如题所述的问题也就解决了。
第二种: 下载补丁包(2007 Microsoft Office System Update: Redistributable Primary Interop Assemblies), 地址是: http://www.microsoft.com/en-us/download/details.aspx?id=18346 下载后安装即可