Skip to content

Instantly share code, notes, and snippets.

@CameronWills
Last active October 7, 2020 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CameronWills/c443f64a24518137324d54e347203e15 to your computer and use it in GitHub Desktop.
Save CameronWills/c443f64a24518137324d54e347203e15 to your computer and use it in GitHub Desktop.
Fix for EpiServer crash: BuildResult change, cache key=cindexingservice.svc.1f180bcd
Steps:
1. Delete IndexingService\IndexingService.svc
2. Add the new IndexingService.cs file below to the project
3. Update the service endpoints in web.config as per the Web.config file below
using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
namespace Web.IndexingService
{
/// <summary>
/// Replacing the logic found in the IndexingService.svc to try and address a bug at where the run-time compiled assembly has a file-change causing the
/// App Domain to shutdown/restart. In some cases the shutdown failed, resulting in two AppDomains to be running. More details here:
/// https://world.episerver.com/forum/developer-forum/Problems-and-bugs/Thread-Container/2019/8/application-restart-loop-because-of-buildresult-change-cache-keycindexingservice-svc-1f180bcd/
/// </summary>
public class IndexingServiceHostFactory : WebServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
var host = base.CreateServiceHost(serviceType, baseAddresses);
var binding = new WebHttpBinding("IndexingServiceCustomBinding");
host.AddServiceEndpoint(typeof(EPiServer.Search.IndexingService.IIndexingService), binding, string.Empty);
return host;
}
}
}
....
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<serviceActivations>
<add factory="Web.IndexingService.IndexingServiceHostFactory"
relativeAddress="IndexingService/IndexingService.svc"
service="EPiServer.Search.IndexingService.IndexingService" />
</serviceActivations>
</serviceHostingEnvironment>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment