2016-10-03 6 views
0

У меня возникли проблемы при попытке загрузить решение (GMap.NET), с которым у меня возникли проблемы с сборкой. Не уверен, что сейчас дело.IIS Express Visual Studio: не удалось загрузить файл или сборку

Я разрабатываю небольшую систему в Visual Studio 2015, которая также имеет проект MVC. Когда я запускаю основной сайт - более или менее просто первоначальный MVC 5 шаблонов - через Visual Studio 2015 - который использует IIS Express - я получаю сообщение об ошибке:

Could not load file or assembly 'System.Web.WebPages.Deployment, Version=1.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.WebPages.Deployment, Version=1.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) [There is more]

Я не знаю, где версия 1.0. 0.0 исходит от! Версия, на которую я ссылаюсь, - 3.0.0.0 ...

Также - если я опубликую на свой локальный IIS - он работает! Я открыл одно и то же решение на двух других компьютерах - и там я могу запустить его из Visual Studio! Это означает - проблема на моем компьютере - не в моем решении ... Я уверен.

Я подозреваю, что что-то испортилось на машине. Может быть, в GAC или в какой-то конфигурации, но я не знаю, где ... Я думаю о таких файлах (не о том, что о них много знаю):

  • C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config \ web.config
  • C: \ Users \\ Documents \ IISExpress \ config \ aspnet.config
  • ???

Для GAC не похоже, что существует System.Web.WebPages.Deployment.dll. И поскольку он работает на «реальном» IIS, он также должен быть в порядке.

Я также попытался удалить все файлы в 'C:/Users/# пользователь #/AppData/Local/Temp/Temporary ASP.NET Files/VS /'

Это должно сократить его до этого: - Проблема должна иметь какое-то отношение к Visual Studio и/или IIS Express - и/или к некоторому файлу конфигурации. - не проблема со ссылками в решении. (Я использовал nuget для установки MVC)

Fx. в этом файле, имеется запись с System.Web.WebPages.Deployment версии 1.0.0.0: C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config \ web.config:

<compilation> 
    <assemblies> 
<!-- <remove assembly="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> 
     <add assembly="System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> -->` 
... 
</compilation> 

Но я уже пытался расколоть его. Никакой разницы ...

Так что, если кто-нибудь может дать мне подсказку, куда искать ... файлы для сравнения или что-то еще, я буду очень благодарен!

Вот полное сообщение, что я получаю:

Server Error in '/' Application.

Could not load file or assembly 'System.Web.WebPages.Deployment, Version=1.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.WebPages.Deployment, Version=1.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.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Program Files (x86)\IIS Express\iisexpress.exe --- A detailed error log follows.

=== Pre-bind state information === LOG: DisplayName = System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///C:/Users/#user#/Source/Workspaces/MySystem/MySystem/Frontend.Web/ LOG: Initial PrivatePath = C:\Users#user#\Source\Workspaces\MySystem\MySystem\Frontend.Web\bin

Calling assembly : (Unknown).

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Users#user#\Source\Workspaces\MySystem\MySystem\Frontend.Web**web.config** LOG: Using host configuration file: C:\Users#user#\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: Attempting download of new URL file:///C:/Users/#user#/AppData/Local/Temp/Temporary ASP.NET Files/vs/0c78498f/ece65cb2/System.Web.WebPages.Deployment.DLL. LOG: Attempting download of new URL file:///C:/Users/#user#/AppData/Local/Temp/Temporary ASP.NET Files/vs/0c78498f/ece65cb2/System.Web.WebPages.Deployment/System.Web.WebPages.Deployment.DLL. LOG: Attempting download of new URL file:///C:/Users/#user#/Source/Workspaces/MySystem/MySystem/Frontend.Web/bin/System.Web.WebPages.Deployment.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Stack Trace:

[FileLoadException: Could not load file or assembly 'System.Web.WebPages.Deployment, Version=1.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)] 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.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'System.Web.WebPages.Deployment, Version=1.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)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +57 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290 System.Web.Compilation.BuildManager.ExecutePreAppStart() +157 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): Could not load file or assembly 'System.Web.WebPages.Deployment, Version=1.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)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9963380 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0

+0

Интересно, вызывает ли другая конфигурация на вашем компьютере проблема. В тех строках, которые вы прокомментировали, что произойдет, если вы оставите удаляемый бит записи в комментарии? –

+0

Теперь я попытался покинуть раздел удаления. Смысл теперь - это только раздел добавления: Пример: -> – jma73

+0

Вы используете истинное значение UseGlobalApplicationHostFile в своем проекте? –

ответ

1

Решение было как упомянуто в моем предыдущем комментарии, что - как есть два (x86 и x64) файлов web.config в соответствии с лицензией. NET Framework (для этой версии, 4): C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Config \ web.con fig C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Config \ web.config - тогда, когда я удаляю записи «System.Web.WebPages.Deployment» в обоих файлах, он работает!

Я не уверен, как они были добавлены в проект, но я подозреваю, что что-то пошло не так, когда я пытался использовать GMap.Net (http://greatmaps.wikia.com/wiki/Main_Page) - и возникли проблемы с его созданием.