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=18.104.22.168, 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()
// Lots of x.For().Use();
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.
My best guess is a missing dll or wrong version of one in bin or wrong assembly redirect in Web.config...
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.