今天遇到一個奇怪問題,有一個ASP.NET項目,訪問時總是顯示不能加載EF4.1的錯誤(項目中對EF的引用都已升級至EF5.0):
Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
說明: 執行當前 Web 請求期間,出現未經處理的異常。請檢查堆棧跟蹤信息,以了解有關該錯誤以及代碼中導致錯誤的出處的詳細信息。
異常詳細信息: System.IO.FileLoadException: Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
源錯誤:
執行當前 Web 請求期間生成了未經處理的異常。可以使用下面的異常堆棧跟蹤信息確定有關異常原因和發生位置的信息。
程序集加載跟蹤: 下列信息有助於確定程序集“EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”未能加載的原因。
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].
問題怪就怪在我找遍整個項目的代碼,也沒找到哪個地方引用了Entity Framework 4.1.0.0。
查看本欄目