无法加载文件或程序集'Excel,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 93517dbe6a4012fa'或其依赖项之一.该系统找不到指定的文件 [英] Could not load file or assembly 'Excel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa' or one of its dependencies. The system cannot find the file specified
问题描述
我收到上述错误.请给我一个解决方案.
我到目前为止所做的,
1)添加了Excel.dll和ICSharpCode.SharpZipLib.dll
2)使用Excel和ICSharpCode.SharpZipLib包含的名称空间
3)在文件上传按钮上,单击,
Hi,
I am getting the above error. Please give me a solution.
What I have done so far,
1) Added Excel.dll and ICSharpCode.SharpZipLib.dll
2) Included namespaces using Excel and using ICSharpCode.SharpZipLib
3) On file upload button click,
protected void btnUpload_Click(object sender, EventArgs e)
{
string xFilePath = fuAlumniList.PostedFile.FileName;
IExcelDataReader excelReader = null;
FileStream stream = null;
}
尽管我只有这么多的代码,但是当我尝试上传一个excel文件时却出现了错误,
无法加载文件或程序集" Excel,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 93517dbe6a4012fa"或其依赖项之一.系统找不到指定的文件"
我正在使用Windows Server 2008 R2(64位操作系统)和MS Office(32位)
[edit]代码块已添加[/edit]
Eventhough I have only this much of code,while I try to upload an excel file I am getting the error,
"Could not load file or assembly ''Excel, Version=2.1.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa'' or one of its dependencies. The system cannot find the file specified"
I am using Windows Server 2008 R2 (64-bit OS) and MS Office (32 bit)
[edit]code block added[/edit]
推荐答案
确保Excel.dll
和所有其他引用的dll在旁边您的可执行代码.
Make sure the Excel.dll
and all other referenced dll''s are beside your executable code.
这篇关于无法加载文件或程序集'Excel,Version = 2.1.0.0,Culture = neutral,PublicKeyToken = 93517dbe6a4012fa'或其依赖项之一.该系统找不到指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!