Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Sitecore 9 #204

Open
davidnguyen opened this issue Nov 15, 2018 · 4 comments
Open

Issue with Sitecore 9 #204

davidnguyen opened this issue Nov 15, 2018 · 4 comments

Comments

@davidnguyen
Copy link

Hi Sergey,

I'm trying Sitecore.FakeDb via NuGet v2.0.0-beta2 with Sitecore 9 update 3 and getting the following exception when trying to get the simplest test to work.
System.NullReferenceException: Object reference not set to an instance of an object.
Result StackTrace: at Sitecore.Configuration.DefaultFactory.CreateType(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, Boolean assert) at Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert) at Sitecore.Configuration.DefaultFactory.GetDatabase(String name) at Sitecore.Configuration.Factory.GetDatabase(String name) at Sitecore.Data.Database.GetDatabase(String databaseName) at Sitecore.FakeDb.Db..ctor(String databaseName)

My app.config file has databaseType set to "Sitecore.Data.DefaultDatabase, Sitecore.Kernel" with the license file in place.

I can't seem to workout why at the moment, any secrete sauce I have to put in to make it tick with Sitecore 9?

Thanks

@sshushliapin
Copy link
Owner

sshushliapin commented Nov 16, 2018 via email

@mikeedwards83
Copy link
Contributor

mikeedwards83 commented Dec 12, 2018

I am having the same problem with Sitecore 9.1.

I have tried assembly binding redirect - no joy.
The config seems correct for the Sitecore 9.1 DB. It only has a name parameter in the constructor

@mikeedwards83
Copy link
Contributor

Hum interestingly the config in memory is:

<database id="master" type="Sitecore.Data.Database, Sitecore.Kernel" singleInstance="true">
<param desc="name">$(id)
<dataProviders hint="list:AddDataProvider">
<dataProvider ref="dataProviders/main" />
<dataProvider ref="dataProviders/language" />

It seems that the DB type is not being updated based on the DB Type specified in the App.config.

@mikeedwards83
Copy link
Contributor

Gah, the test runner wasn't copying the new App.config across after it had been changed. So the change of the DB type was not being picked up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants