После обновления пакета mvc nuget с версии 5.1.0 до 5.2.2 наша машина (webrole) на Azure отказывается запускать веб-роль. Это было в состоянии утилизации. Я нашел ошибку в журнале событий:Asp.net MVC 5.2.2 на Azure
The description for Event ID 1007 from source Windows Azure Runtime 2.4.0.0 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
820
WaIISHost
Role entrypoint could not be created: System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=5.1.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)
File name: 'System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
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].
---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
the message resource is present but the message is not found in the string/message table
Я попытался выполнить поиск через Интернет, но без полезного ответа. Я не смог его решить иначе, как понизить. К счастью, версия пакета 5.1.1 работает.
Update 1: После нескольких проб и ошибок я нашел, что ASP.NET MVC пакеты ОК до версии 5.1.3 Похоже, пакеты с 5.2.0 вверх не поддерживаются.
Обновление 2: Мы решили разбить наш веб-сайт и web.api, так что у меня больше не было этой проблемы. Мое лучшее предположение, что был действительно nuget, который ссылался на старый пакет asp.net mvc.
DO скопировать новый MVC DLL к вашей папке бин приложений? – TomTom
@TomTom Я предполагаю, что это автоматически выполняется путем обновления пакета nuget. Я проверил это во время моего расследования, а Copy Local - True. –