1. 程式人生 > >MVC本地執行正常,釋出之後報錯 0x80131040

MVC本地執行正常,釋出之後報錯 0x80131040

mvc在本地已經執行正常了,釋出之後有一頁出現錯誤,之後在server上直接執行,報錯如下:

 Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=4.0.0.0, 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)

錯誤圖片如下:

在網上搜了很多資料,試了很多方法,最終找到了:就是reference專案裡Manage Nuget  Packages,安裝ASP.NET MVC,之後重新發布一次就可以了,所以趕緊記下來,也供其他同學參考