Last active
October 7, 2020 00:22
-
-
Save CameronWills/c443f64a24518137324d54e347203e15 to your computer and use it in GitHub Desktop.
Fix for EpiServer crash: BuildResult change, cache key=cindexingservice.svc.1f180bcd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
<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