London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

IContentLoader always returns null/throws Exception when getting

Vote:
 

In a scheduled job, I'm retrieving content that I've found via Find. When passing an instance of a EPiServer.Find.Cms.IndexableContentReference (that happens to point at a BundleContent) to IContentLoader, it throws an exception telling me it does not exist. This happens even if I say _contentLoader.Get<IContent>(...).

However, if I simply create a new ContentReference(1234) { ProviderName = "CatalogContent" } it works as expected, and I get my content back.

I guess this should be fixed in some way...

#111684
Oct 17, 2014 13:44
Vote:
 
<p>Do you get the issue while running the Job manually also?<br />/K</p>
#111686
Oct 17, 2014 14:02
Vote:
 
<p>Also, if I use <strong>_contentLoader.Get&lt;IContent&gt;(...)</strong> with my new, manually created <strong>ContentReference</strong>, it works. If I, however, try to say <strong>_contentLoader.Get&lt;Bundle&gt;(...) </strong>it gives me nothing.</p> <p>After retrieving from <strong>IContentLoader</strong> as <strong>IContent</strong>, I can however say&nbsp;<strong>myContent as Bundle</strong> and get the proper Bundle object. <strong>Bundle</strong> does inherit from <strong>BundleContent</strong>, as one should be expecting.</p>
#111687
Oct 17, 2014 14:04
Vote:
 
<p>K Khan: Yes.</p>
#111688
Oct 17, 2014 14:05
Vote:
 
<p>And I now wish I could delete or edit my own posts or threads, cus this is just not true.&nbsp;My index was just ever so slightly out of sync with the database for some reason.</p> <p><strong>Case closed!</strong></p>
#111690
Oct 17, 2014 14:17
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.