我昨天運行了Windows Update,並在我嘗試釋放ASP.NET MVC 4項目的新版本時引入了一些問題。窗口更新Brooke MVC應用程序
應用程序編譯,當我推的版本爲什麼要在我的網絡服務器測試站點它倒下,出現錯誤消息沒關係但是本地運行,:
System.Web.HttpCompileException: (0): error CS1705: Assembly 'App_Code, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
經過一番研究,我發現,這是由於從4.0.0.0到4.0.0.1的更新。我從我的項目中刪除了System.Web.Mvc dll,並且閱讀了具有更高版本的dll。再次,一切工作在本地,但不在網上。然後我瀏覽了web.config,並將4.0.0.0中的任何內容更改爲4.0.0.1。同樣,這繼續在內部工作,但在外部失敗。該錯誤信息是:
Could not load file or assembly 'System.Web.Mvc, Version=3.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) 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.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.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) 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 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded. 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].
我相信這事做與我使用了錯誤處理ELMAH。
我試圖從Nuget重新安裝,如下面的建議:Windows update caused MVC3 and MVC4 stop working但這並沒有奏效,我得到了同樣的錯誤。
添加信息: 服務器尚未更新,我擔心更新此可能會破壞現有的實時版本。
[ASP.NET MVC安全修補程序版本3.0.0.1打破構建]的可能重複(http://stackoverflow.com/questions/26406877/asp-net-mvc-security-patch-to-version-3- 0-0-1-break-build) – 2014-10-17 13:08:02