原本正常的網站
改移到64位元電腦後,突然出現下列狀況,LinqToExcel元件出現異常
Server Error in ‘/Web’ Application.
Could not load file or assembly ‘LinqToExcel’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly ‘LinqToExcel’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly ‘LinqToExcel’ could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly
bind failure logging, set the registry value
[HKLMSoftwareMicrosoftFusion!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 [HKLMSoftwareMicrosoftFusion!EnableLog].
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
WRN: Assembly binding logging is turned OFF. To enable assembly
bind failure logging, set the registry value
[HKLMSoftwareMicrosoftFusion!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 [HKLMSoftwareMicrosoftFusion!EnableLog].
主要是因為下載的元件是32位元版=>64位元檔案請參考這邊http://blog.yodersolutions.com/2008/11/microsoftjetoledb-and-x64-machines/
只要將網站執行的Application Pool開啟32位元相容即可!!
IIS7位置在=>Application Pools=>選擇網站執行的Pool=>Advanced Settings
Enable 32-Bit Application 設定成 True即可!
謝謝分享~ 幫忙解決了困擾我一整天的問題
喝~不客氣~^^