Object reference not set to an instance of an object - problem on Mediachase.Commerce.Initialization.CommerceInitialization.Initialize

Vote:
 

I have a solution where I need to start with an empty Commerce database.

I have created a database and I have run the SQL-script in the EPiServer.Commerce.Core' tool folder.

But when starting up the project I get this error:

[NullReferenceException: Object reference not set to an instance of an object.]
   Mediachase.Commerce.Customers.Plugins.AutoInstallMetaDataModule.CreateMembershipAcount(String login, String email, Object userProviderKey) +79
   Mediachase.Commerce.Customers.Plugins.AutoInstallMetaDataModule.CreateContact(String firstName, String lastName, String email, String login, String role) +396
   Mediachase.Commerce.Customers.Plugins.AutoInstallMetaDataModule.InstallCustomersDemoData() +114
   Mediachase.Commerce.Customers.Plugins.AutoInstallMetaDataModule.Execute(BusinessContext context) +177
   Mediachase.Commerce.Initialization.CommerceInitialization.Initialize(InitializationEngine context) +481
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +57
   EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +122
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +247

[InitializationException: Initialize action failed for Initialize on class Mediachase.Commerce.Initialization.CommerceInitialization, Mediachase.Commerce, Version=12.17.2.0, Culture=neutral, PublicKeyToken=6e58b501b34abce3]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +774
   EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +194
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +876
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +225
   EPiServer.Global..ctor() +42
   [Customer].Global..ctor() +37
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\5eb2aa82\8b3434ee\App_global.asax.iudbsmu2.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +139
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +105
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1431
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +184
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +80
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +182
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714

Anyone know what it can be and how to solve it?

#204301
May 24, 2019 16:03
Vote:
 

if you are not using membership provider (which I guess you aren't), set demoInstall in configs\ecf.customer.config to false would solve it

#204306
May 24, 2019 18:19
Vote:
 

Yes, that worked.

Thanks Quan!

#204312
May 27, 2019 8:40
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.