Tôi đã chạy Windows Update ngày hôm qua và giới thiệu một số vấn đề khi tôi đang cố gắng phát hành phiên bản mới của dự án ASP.NET MVC 4 của tôi.Cập nhật cửa sổ Ứng dụng Broke MVC
Ứng dụng biên dịch và chạy ổn tại địa phương, tuy nhiên khi tôi đẩy phiên bản lên đến một bài kiểm tra tại chỗ trên máy chủ web của tôi nó đã giảm hơn với thông báo lỗi:
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'
Sau khi một số nghiên cứu tôi thấy rằng đây là do cập nhật từ 4.0.0.0 đến 4.0.0.1. Tôi loại bỏ các System.Web.Mvc dll từ dự án của tôi và readded dll có phiên bản sau này. Một lần nữa mọi thứ hoạt động cục bộ nhưng không hoạt động trên web. Sau đó tôi đã đi qua web.config và thay đổi bất kỳ đề cập đến từ 4.0.0.0 đến 4.0.0.1. Tương tự như vậy, điều này tiếp tục làm việc nội bộ nhưng không thành công bên ngoài. Thông báo lỗi là:
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].
Tôi tin rằng điều này có liên quan đến Elmah mà tôi đang sử dụng để xử lý lỗi.
Tôi đã cố gắng cài đặt lại từ Nuget như được đề xuất ở đây: Windows update caused MVC3 and MVC4 stop working nhưng điều đó không hiệu quả và tôi gặp lỗi tương tự.
Thông tin đã thêm: Máy chủ chưa được cập nhật, tôi lo ngại rằng việc cập nhật điều này có thể làm hỏng phiên bản hiện tại.
thể trùng lặp của [bản vá bảo mật ASP.NET MVC lên phiên bản 3.0.0.1 phá vỡ xây dựng] (http://stackoverflow.com/questions/26406877/asp-net-mvc-security-patch-to-version-3- 0-0-1-break-build) –