Я установил Windows 10 на 2 новых виртуальных машины. Установленный Visual Studio 2013 с Update 5. Получил решение, которое содержит веб-приложение MVC, которое использует IIS.Windows 10 MVC Не удалось загрузить файл или сборку «System.Web.Mvc» или один, если это depdencies. 0x80131040
Теперь на обеих виртуальных машинах веб-приложение не загружается. Определение манифеста расположенной сборки не соответствует ссылке на сборку.
Я удалил сборку из NuGet и добавил ее обратно, я удалил папку с bin, почти все, что мог найти в Интернете.
Перенаправление в web.config представляется правильным,
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
версия NuGet установлена в 5.2.3 На окнах 8 или Windows 7 машин, это не проблема.
Опять же, это совершенно новая установка, и была установлена только Visual Studio 2013 Ultimate.
Что странно, если я пойду и создаю новое веб-приложение MVC, оно будет загружено.
Я включил Fusion и вот журналы.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = System.Web.Mvc
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Web.Mvc | Domain ID: 9
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/TFS/AppName/Trunk/SL.Main/
LOG: Initial PrivatePath = C:\TFS\AppName\Trunk\SL.Main\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\TFS\SLHV01\AppName\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/slmain/64560d57/1f691ecd/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/slmain/64560d57/1f691ecd/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/AppName/bin/System.Web.Mvc.DLL.
LOG: Using application configuration file: C:\TFS\SLHV01\SmartLogix\SmartLynx\SmartLynx\UI\Trunk\SL.Main\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.0.0.1 redirected to 5.2.3.0.
LOG: Post-policy reference: System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/slmain/64560d57/1f691ecd/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/slmain/64560d57/1f691ecd/System.Web.Mvc/System.Web.Mvc.DLL.
LOG: Attempting download of new URL file:///C:/TFS/AppName/bin/System.Web.Mvc.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Трассировка стека:
[FileLoadException: Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
[FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.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)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +234
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +108
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +25
System.Reflection.Assembly.Load(String assemblyString) +34
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +49
[ConfigurationErrorsException: Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.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)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +772
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +256
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +58
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +237
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +101
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +142
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +907
[HttpException (0x80004005): Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.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)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +726
Примечание заменить свои каталоги с именем приложения в файле путей.
Замечание: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Запуск этой темы, чтобы попробовать войти и, надеюсь, помочь другим. Поскольку это происходит с двумя установками, я предполагаю, что это, вероятно, произойдет и с другими.
Я пытаюсь понять, откуда будет происходить несоответствие.
8/7/15 - После того, как я понял, VS-сборка помещает неправильную версию MVC в папку bin. (Я вчера проверил.) Если я передаю Visual Studio и просто откройте веб-сайт прямо в браузере, чтобы не было сборки, а папка Bin обновлена, откроется сайт.
Теперь, пытаясь выяснить, почему, если ссылка на System.Web.Mvc равна 5.2.3, а пакет nuget соответствует, то почему сборка помещает версию 4 в папку bin.
Вы проверили, что сборка находится в папке с корзиной? Вы работаете под IIS или IIS Express? –
Поскольку новый проект работает, вы можете использовать что-то вроде WinMerge для сравнения решений и файлов проектов с существующими приложениями с совершенно новыми версиями. –
Это новое решение - один проект, другой - большое 27 проектных решений. Одна вещь, которую я заметил, - это временное решение, которое я создал, я размещал его в IIS, но во временной папке Asp.Net Files нет папки. Кроме того, я попытался изменить веб-сервер для основного проекта на IIS Express, все еще ту же ошибку. – kfrosty