• Not Answered

Message: System.InvalidOperationException : Service Sitecore.Abstractions.ICorePipeline was not registered in container

I am writing unit test to read from ContentSearchManager.GetIndex method.

At line "ContentSearchManager.GetIndex(indexableItem)" in below code :

Sitecore.Context.SetActiveSite("<<Site name>>");

// Pull the start path of the site
string startPath = Sitecore.Context.Site.StartPath;

// Pull the database name
string databaseName = Sitecore.Context.Site.Database.Name;

// Load the web database, and get item
var db = Sitecore.Data.Database.GetDatabase("web");

var item = db.GetItem("<<bucket item>>");
var indexableItem = (SitecoreIndexableItem)item;
var index = ContentSearchManager.GetIndex(indexableItem);

I am getting error

> Service Sitecore.Abstractions.ICorePipeline was not registered in container

Complete stack trace message is :

at Sitecore.ContentSearch.Abstractions.ObjectLocator.GetInstance[TService]()
at Sitecore.ContentSearch.ContentSearchManager.GetContextIndexName(IIndexable indexable)
at Sitecore.ContentSearch.ContentSearchManager.GetIndex(IIndexable indexable)
at MyRadiometerTest.Services.SimpleTests.assert_that_search_working() 

Please suggest if anyone has fixed such issue or has idea about it.