Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Activation Error on IStatisticTagsHelper

$
0
0

Hi, I have a standalone project in a .NET solution that gets compiled to a DLL and used in another solution. The regular Find functionality works great, however, in trying to add statistics tracking we have run in to an issue with the Service Locator apparently not being able to resolve the IStatisticTagsHelper interface when we add .Track() to our search query. We are trying to avoid adding too many references, so most likely that is the issue here, but perhaps not.

The code: 

            var results = query.Skip((iPage - 1) * m_iRecordsPerPage)
                               .Take(m_iRecordsPerPage)
                               .Select(r => new SearchResultItem { Title = r.SearchTitle, Url = r.SearchHitUrl, MetaData = r.SearchMetaData })
                               .Track()
                               .GetResult()
                               .ToList();

The exception: 

An exception of type 'EPiServer.ServiceLocation.ActivationException' occurred in EPiServer.Framework.dll but was not handled in user code

Additional information: Activation error occurred while trying to get instance of type IStatisticTagsHelper, key ""

at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
at EPiServer.Find.Framework.Statistics.TrackableSearchExtensions.AddDefaultTags(IEnumerable`1 tags)
at EPiServer.Find.Framework.Statistics.TrackableSearchExtensions.Track[TSource](ISearch`1 search, IEnumerable`1 tags)
at EPiServer.Find.Framework.Statistics.TrackableSearchExtensions.Track[TSource](ISearch`1 search)
at AAP.Website.Search.Data.EPiServerFind.SearchClient.GetSearchResultWithPagination(String sSearchTxt, Int32 iPage, Boolean bPageOnly, FindResults oFindResults, Int32 iRecordLimitForFilters, Boolean bShowFacets, Boolean bSiteSpecific, String sSpecificSite) in C:\w\AAP\AAP.Website.Search\AAP.Website.Search.Data\EPiServerFind\SearchClient.cs:line 172
at AAP.Website.Search.Controllers.SearchController.<>c__DisplayClass6_1.<Find>b__0() in C:\w\AAP\AAP.Website.Search\AAP.Website.Search\Controllers\SearchController.cs:line 105
at System.Threading.Tasks.Task.InnerInvoke()

We have added the following Episerver nuget packages to this project:

EPiServer.CMS

EPiServer.CMS.UI

EPiServer.Find

EPiServer.Find.Framework

EPiServer.Framework

The ServiceLocation project was added through the EPiServer.CMS feed. Is there anything else we need?


Viewing all articles
Browse latest Browse all 6894

Trending Articles