简体   繁体   English

在配置运行asp.net应用程序的IIS时读取excel错误

[英]reading excel error on configuring IIS of running asp.net application

I am running my asp.net application on Window Server 2008. 我正在Windows Server 2008上运行asp.net应用程序。

IF I enable x86 application on ISS, it is running fine with excel 2003 files: xls 如果我在ISS上启用了x86应用程序,则可以在excel 2003文件中正常运行:xls

But then I got a problem of running excel 2007: (Microsoft.ACE.OLEDB.12.0). 但是随后我遇到了运行excel 2007的问题:(Microsoft.ACE.OLEDB.12.0)。 If I switch it back to x64 mode, then it is running fine with excel 2007. 如果我将其切换回x64模式,则可以在excel 2007中正常运行。

So, how I config it or install something on my server in order to run both? 那么,如何配置它或在服务器上安装某些东西以同时运行它们?

Thanks in advance. 提前致谢。

If you compiled your app for "Any CPU" it will run as a 32bit process when you set IIS to enable 32bit applications. 如果为“任何CPU”编译应用程序,则在将IIS设置为启用32位应用程序时,它将作为32位进程运行。 Once your app is running as a 32 bit process, any DLLs it needs to use during execution will be expecting to see 32bit binaries; 一旦您的应用程序以32位进程运行,则在执行过程中需要使用的所有DLL都将看到32位二进制文​​件。 It will not be able to chop and change between 32/64 bit images once the process is running. 一旦进程开始运行,它将无法在32/64位图像之间进行切换和切换。 So, i suspect you need a 32 bit install of Excel 2007. 因此,我怀疑您需要32位安装的Excel 2007。

我通过始终将Excel 2007用于Excel 2003和Excel 2007来解决了该问题,并且它可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM