Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

After upgrade to .net6, tried to include Episerver.Find.Cms(14.2.4) to application then the front end website breaks.


We have recenlty upgraded the solution from .net 5 to .net 6 using the Episerver.CMS 12.5.1 version and the website works as expected. Now we are including the Episerver.Find.CMS(14.2.4), and also we haven't made any customization around Find dll.  After this, we are able to access the url: Episver/Find/ and i can do the indexing of the pages as well, navigate through pages on the conosle level.

But the issue is on the front end side,  when i tried to access any page from webssite it works for the first time and the site breaks either if i naviagte to other pages or refresh the current page. Here is the error 

I have tried with 15.0.0 of EPiserver.Find.CMS to see if helps to resolve the issue but no luck there.

Happy to know if you have any guess around this isuse.

Feb 20, 2023 19:51

Have you a custom ClientResourceExtensions.RequiredClientResources (Or something else) that might already be adding a defer attribute to scripts ? 

Edited, Feb 20, 2023 22:02

Would it be possible to run this code somewhere:

            string TrackingScriptName = "epi.find.trackingScript";

            var clientResourceService = ServiceLocator.Current.GetInstance<IClientResourceService>();

            var trackingScripts = clientResourceService.GetClientResources(TrackingScriptName, new[] { ClientResourceType.Script }).ToList();

what can you see in trackingScripts  ? It seems like you have duplicated resource registration in your module.config.

Feb 21, 2023 7:47

We don't have any custom for this ClientResourceExtensions.RequiredClientResources.

Feb 21, 2023 17:36


I tried to run the code and what i see in trackingScripts is zero for the first time but when i refresh the page again i notice there is one script for "epi.find.trackingScript" which has a defer attribute already which is breaking the page.

Feb 21, 2023 17:41

In startup file, registering the services.AddSingleton<IClientResourceService, ClientResourceService>();. After removing this service regsiter the site is now working as expected. 

Before adding the find to the application, the site intially working with service(IClientResourceServic) register. Any thoughts around this? 

Feb 23, 2023 15:21

Do you have AddCmsFrameworkWeb() ? it would call that registration already

I think it register ClientResourceService as Transient, which is why when you regsiter as AddSingleton things will be called twice. 

Feb 24, 2023 10:03
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.