Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutra...

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: 

Line 46: 				<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 47: 				<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 48: 				<add assembly="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
Line 49:       </assemblies>
Line 50: 		</compilation>

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.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
上述问题的解决方法有两种:
第一种:

1)、如果系统未安装.Net Framework,请先安装,如果已安装了的话就可直接进行第二步。

2)、在“添加或删除程序”中对Office进行“更改”安装操作,将漏装部分重新安装上去即可。具体操作如下面的图片:

如下图:添加或删除Office功能

如下图:对应用程序进行高级自定义

如下图:在“.Net 可编程性支持”选项的下拉菜单中选择“从本机运行”或“从本机运行全部程序”。

经过以上步骤的安装后,Office 2003 PIA就会被安装到GAC里去了,可以从以下目录看到:“C:\Windows\assembly”,从而如题所述的问题也就解决了。

 
第二种:
下载补丁包(2007 Microsoft Office System Update: Redistributable Primary Interop Assemblies), 地址是:
下载后安装即可
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值