November Happy Hour will be moved to Thursday December 5th.

Contentprovider error. Cannot create an instance

Vote:
 

I am trying to covert an Episerver 6 pageprovider  to a contentprovider but I am getting into difficuties tring to hook it up. I have looked at the clonedpageprovider to see how it is done. Problem is that I have to add my provider to episerver.config. But when I do that I always get "Cannot create an instance of type [The provider I have added]".

I have also  tried to create a clean provider:

using EPiServer.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Test.ContentProviders
{
public class TestProvider : ContentProvider
{
protected override IContent LoadContent(ContentReference contentLink, ILanguageSelector languageSelector)
{
throw new NotImplementedException();
}

}
}

and added 

<contentProvider>
<providers>
<add name="Test"
type="Test.ContentProviders.TestProvider"
entryPoint="9" />
</providers>
</contentProvider>

to episerver.config. But I get the same error. The thing is that i can change type to somthing non exsiting and it also gives me the same error. Therefor I tought maybe there is some detail I hace missed in my configuration

#86441
May 21, 2014 15:36
Vote:
 

Try to add the assembly as well to the type attribute like 

type="Test.ContentProviders.TestProvider, MyAssembly"

#86546
May 23, 2014 11:57
Vote:
 

I have tried that before without success but now it worked. Thank you.

#86735
May 29, 2014 11:00
* 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.