SaaS CMS has officially launched! Learn more now.

basic find test EPiServer 7.5 Allow MVC Templates...


I've just setup a brand new EPiServer 7.5 site (the deployment manager) and installed the allow MVC Templates, and I've installed find..
I've added the new web.config section, as well as installing the required NUGet packags..


I want to do a basic test, so I added the following code initally to the existing search page 

            var myITems = SearchClient.Instance.Search<IContent>()


I am not yet doing anything with these results (that's to come..), but I get the following error:

Type specified in JSON 'EPiServer.Templates.Alloy.Models.Blocks.EditorialBlock, EPiServer.Templates.Alloy.Mvc, Version=, Culture=neutral, PublicKeyToken=null' is not compatible with 'EPiServer.Core.IContent, EPiServer, Version=7.5.440.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'. Path 'hits.hits[0]._source.$type', line 1, position 400.


This is my first venture into Find, so am I missing something here?
One thing I did have to do when setting this up as update the Version of StructureMap, as it as referencing a different version  

I have run the schedule job to index the entire site ..


Jan 20, 2014 17:02

I replaced GetResult() with GetContentResult() and no longer get the error...

Right! I didn't include a .Select .. so it thew the error.. I added in  .Select(x => new { Title = x.Name, URl = x.LinkURL }) and error went away..

Edited, Jan 20, 2014 17:08

In order to successfully deserialize IContent data, such as PageData, use the GetContentResult extension method. You can read more about it here:

Jan 20, 2014 18:57
* 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.