Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutra...
2013-10-10 15:20
627 查看
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.
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
下载后安装即可
<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 configurationfile 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> |
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), 地址是:
http://www.microsoft.com/en-us/download/details.aspx?id=18346
下载后安装即可
相关文章推荐
- Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e94
- Asp.Net 关于Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies.问题的解决方法。
- Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e94
- Asp.Net 关于Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e
- Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5
- Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, Public
- Could not load file or assembly 'ESRI.ArcGIS.SOESupport, Version=10.1.0.0, Culture=neutral, PublicKe
- Could not load file or assembly 'Microsoft.Office.Interop.Excel
- Could not load file or assembly 'AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e'
- Could not load file or assembly "Microsoft.DataTransformationServices.Design,Version=12.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91" or one of its dependencies.
- Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=n
- SAP3.0相关问题,Could not load file or assembly 'sapnco, Version=3.0.0.42
- Could not load file or assembly 'XXX' or one of its dependencies
- Could not load file or assembly 'App_Web_xxxx' or one of its dependencies. The system cannot find the file specified.
- Could not load file or assembly'System.EnterpriseServices'
- Could not load file or assembly '*.dll' or one of its dependencies.
- .NET Web 执行错误Could not load type '...' from assembly '..., Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because the me
- Parser Error Message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies.解决方法
- Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0 系统找不到指定的文件
- SQLite 解决:Could not load file or assembly 'System.Data.SQLite ... 试图加载格式不正确的程序