London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Episerver Commerce 10.0.1.0: "Object reference not set to an instance of an object" on startup

Vote:
0

I followed the tutorial to create an Episerver Commerce web site:

http://world.episerver.com/documentation/getting-started/commerce/2--creating-your-project/

But an "Object reference not set to an instance of an object" exception occurs when I run the app and go to the admin page:

http://localhost:60244/EPiServer

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   EPiServer.Commerce.Marketing.PromotionTypeHandler.SetPromotionsAvailability(IEnumerable`1 promotionTypes, Boolean available) +190
   EPiServer.Commerce.Initialization.InitializationModule.EnableAllPromotions(InitializationEngine context) +60
   EPiServer.Commerce.Initialization.InitializationModule.Initialize(InitializationEngine context) +173
   EPiServer.Framework.Initialization.Internal.<>c__DisplayClass3_0.b__0() +19
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +52
   EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +80
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +245

[InitializationException: Initialize action failed for Initialize on class EPiServer.Commerce.Initialization.InitializationModule, EPiServer.Business.Commerce, Version=10.0.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +588
   EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +114
   EPiServer.Framework.Initialization.InitializationEngine.Initialize() +32
   EPiServer.Framework.Initialization.<>c.b__7_0(InitializationEngine e) +9
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +366
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +170
   EPiServer.Global..ctor() +76
   ASP.global_asax..ctor() in C:\Users\edath\AppData\Local\Temp\Temporary ASP.NET Files\vs\e209e0ea\14766660\App_global.asax.ap7yc6lw.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) +114
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1088
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +20
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +260
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9963380
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
#171697
Nov 15, 2016 13:03
Vote:
0

I've replicated this issue on another development server. It would be great to solve this issue soon. 

#171815
Nov 18, 2016 0:48
Vote:
0

Try starting the front end site and login to run the migration steps to upgrade the commerce db.

#171866
Nov 19, 2016 19:26
Vote:
0

Awesome!! Thanks Tomas. That worked.

#171869
Nov 19, 2016 22:18
Vote:
0
<p>Hi,&nbsp;</p> <p>Is this the only solution to this problem? We have a couple of developers working on the same solution with Commerce 9.22 and intermittently we're all getting this error.&nbsp;</p> <p>We're working on a shared database but nobody has updated their version of commerce to 10.</p> <p></p> <p>/Mark</p>
#174758
Feb 03, 2017 11:24
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.