2

I'm upgrading my Sitecore 8.1 Visual Studio project to use Sitecore 8.2, and I've made quite a bit of progress. I've switched to SOLR, updated Glass Mapper, and replaced out my DLL references to use the Sitecore supplied NuGet package manager. The issue that I've hit now I believe is related somehow to the new SOLR implementation that doesn't use DI. I am getting the following error:

Server Error in '/' Application.

Could not load file or assembly 'Microsoft.Practices.ServiceLocation, 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 'Microsoft.Practices.ServiceLocation, 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 'Microsoft.Practices.ServiceLocation, Version=1.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].

Stack Trace:

[FileLoadException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, 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)]
Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.IntegrationHelper.IsSolrConfigured() +0 Sitecore.ContentSearch.SolrProvider.Pipelines.Loader.InitializeSolrProvider.Process(PipelineArgs args) +28 (Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +259
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Practices.ServiceLocation, 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) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712

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

I've tried several things, including changing the dependentAssembly to point to the correct publicKeyToken (which is 59d6d24383174ac4 and not 31bf3856ad364e35 as the error message suggests). I'd appreciate any help that you all can provide. Thanks!

  • I added to my answer the issue with SOLR. There's no longer a need to use the SOLR Support DLL'S in 8.2. – Pete Navarra Sep 30 '16 at 23:45
  • Have you tried enabling assembly binding log to see which assembly is causing problem? – Szymon Kuzniak Oct 1 '16 at 11:07
4

You'll want to make sure that you update all your projects to .NET 4.5.2+ in the Project Properties Screen. You'll need to do this for every project in the solution.

You will also want to make sure the VS Extention for Microsoft Practices is updated.

Also, do not use the SOLR Support Packages DLL. SOLR is now natively in the Sitecore dll's. Just enable the 8.2 Solr configs.

  • 2
    Your last statement about not using the SOLR Support packages DLLs really was the key for me. I had setup a sandbox without those DLLs and everything was working, so I ended up comparing the DLLs in my bin folder to those from a clean install, and was able to find the problem files. – Keith VanderVeen Oct 3 '16 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.