在本地運行Asp.Net MVC應用程序時,一切運行正常,但在服務器上部署應用程序時,出現此錯誤。無法加載文件或程序集XXX或其某個依賴項。位於程序集的清單定義與程序集引用不匹配
Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
我最近剛添加過的NuGet的System.Web.Optimization
框架,利用WebGrease的。
如果我檢查參考文獻,我的WebGrease版本是1.5.2.14234,比抱怨找不到的版本 - 1.5.1.25624高。
內的根web配置,我有以下的運行時標籤下:
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
如果我檢查服務器上的bin文件夾內的WebGrease.dll的WebGrease DLL的版本是1.5。 2.14234。誰可能要求其他版本1.5.1.25624以及任何想法如何解決?
非常感謝!
感謝您的評論,但正如我在前面的回答中描述,這是由於錯誤的web.config文件中爲前解釋解決。 –
如果您的應用程序池在未啓用32位的情況下啓動,則可能發生此錯誤,但您可以將其更改爲啓用狀態(與「WebGrease」無關)。這個答案解決了這個問題。 –