Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

No Default Instance defined for PluginFamily EPiServer.Data.IDatabaseHandler

Vote:
 

I'm working on upgrading an Episerver solution from 6 R2. I'm on version 8.11 at the moment.

Some of the old code uses Dynamic Data Store. When I run the code that reads content from the DDS, I get the following error:

StructureMap Exception Code: 202 No Default Instance defined for PluginFamily EPiServer.Data.IDatabaseHandler, EPiServer.Data, Version=8.11.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7

I'm trying to figure out how to configure this in StructureMap:

I have tried this code:

public static void ConfigureStructureMap()
{
    ObjectFactory.Initialize(x =>
    {
        // Lots of x.For().Use();
        x.For().Use(new SqlDatabaseFactory().CreateDefaultHandler());
    });
}

Then I get rid of the above error message, but I get other errors instead when I'm trying to write to the DDS:

Call from wrong thread - the DatabaseHandler classes are not thread safe!

From Episerver's documentation, it seems I should not use SqlDatabaseFactory this way: "This class supports the EPiServer infrastructure and is not intended to be used directly from your code." I guess it is intended for mocking and creating tests.

What can cause Episerver to not initialize its implementation of IDatabaseHandler properly?

Is there a way for me to initialize it myself (like I'm trying to with SqlDatabaseFactory) where it will work?

I'm thankful for any help I can get.

#144756
Feb 18, 2016 13:08
Vote:
 

My best guess is a missing dll or wrong version of one in bin or wrong assembly redirect in Web.config...

#144846
Feb 19, 2016 16:29
Vote:
 

I have not been able to get any further on this, but I still believe that I should not have to add an implementation of IDatabaseHandler.

#145492
Mar 04, 2016 14:44
* 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.