SolrNET - Could not load file or assembly 'HttpWebAdapters' when pulling from Nuget

StackOverflow https://stackoverflow.com/questions/4423416

  •  09-10-2019
  •  | 
  •  

문제

I am using Nuget to get the latest version of SolrNET and StructureMap.SolrNetIntegration in my ASP.NET MVC project.

x.IncludeRegistry(new SolrNetRegistry(((SolrConfigurationSection)ConfigurationManager.GetSection("solr")).SolrServers));

When the above line of code is invoked I receive the following error:

Could not load file or assembly 'HttpWebAdapters, Version=0.3.0.0, Culture=neutral, PublicKeyToken=bc21753e8aa334cb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I am concurrently upgrading to the latest version (0.3.0) as well as pulling solrnet from Nuget for the first time - previously this same code worked with the previous distribution downloaded directly from the SolrNET site. I can see that the issue occurs in the structuremap.solrintegration project when constructing the solrnetregistry, but I'm at a loss as to why

[FileLoadException: Could not load file or assembly 'HttpWebAdapters, Version=0.3.0.0, Culture=neutral, PublicKeyToken=bc21753e8aa334cb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   StructureMap.SolrNetIntegration.SolrNetRegistry..ctor(SolrServers solrServers) in c:\prg\SolrNet\svn\StructureMap.SolrNetIntegration\SolrNetRegistry.cs:40
   myproj.Core.BootStrapper.<ConfigureStructureMap>b__1(IInitializationExpression x) in C:\Users\jp\Documents\Visual Studio 2010\Projects\myproj\myproj.Core\BootStrapper.cs:66
   StructureMap.ObjectFactory.Initialize(Action`1 action) +143
   myproj.Core.BootStrapper.ConfigureStructureMap() in C:\Users\jp\Documents\Visual Studio 2010\Projects\myproj\myproj.Core\BootStrapper.cs:37
   myproj.Core.MvcApplication.Application_Start() in C:\Users\jp\Documents\Visual Studio 2010\Projects\myproj\myproj.Core\Global.cs:131

Does anyone know if something has changed or if I am doing anything incorrectly?

Thanks

JP

도움이 되었습니까?

해결책

The SolrNet.StructureMap NuGet package was incorrectly built. I already fixed it and sent a pull request to the NuGet team. EDIT: the fix is in.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top