I riceved this error on a new server:
No database instance
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ApplicationException: No database instance
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[ApplicationException: No database instance]
Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context) +1843
System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +66
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +596
System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +208
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +266
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +72
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +64
System.Linq.Queryable.OrderBy(IQueryable`1 source, Expression`1 keySelector) +85
Nop.Services.Stores.StoreService.<GetAllStores>b__0() +358
Nop.Core.Caching.CacheExtensions.Get(ICacheManager cacheManager, String key, Int32 cacheTime, Func`1 acquire) +337
Nop.Core.Caching.CacheExtensions.Get(ICacheManager cacheManager, String key, Func`1 acquire) +149
Nop.Services.Stores.StoreService.GetAllStores() +171
Nop.Web.Framework.WebStoreContext.get_CurrentStore() +361
Nop.Web.Framework.SettingsSource.<BuildRegistration>b__5(IComponentContext c, IEnumerable`1 p) +124
Autofac.Builder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) +15
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +32
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +89
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +157
Autofac.Core.Resolving.InstanceLookup.Execute() +164
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +168
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +32
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +89
Autofac.Core.Resolving.InstanceLookup.Execute() +181
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +168
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +170
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +333
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +89
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +157
Autofac.Core.Resolving.InstanceLookup.Execute() +164
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +168
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +32
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +89
Autofac.Core.Resolving.InstanceLookup.Execute() +181
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +168
Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +170
Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +333
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +89
Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) +157
Autofac.Core.Resolving.InstanceLookup.Execute() +164
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +168
Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) +32
Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters) +89
Autofac.Core.Resolving.InstanceLookup.Execute() +181
Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) +168
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +57
[DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> No database instance (See inner exception for details.)]
Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) +293
Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) +168
Autofac.ResolutionExtensions.Resolve(IComponentContext context, IEnumerable`1 parameters) +117
Nop.Core.Infrastructure.DependencyManagement.ContainerManager.Resolve(String key, ILifetimeScope scope) +263
Nop.Core.Infrastructure.NopEngine.Resolve() +167
SevenSpikes.Nop.Framework.InstallHelper.InstallLocaleResources(String pluginFolderName, String fileNameWithoutCultureAndExtension, Boolean updateExistingResources) +251
SevenSpikes.Nop.Plugins.Core.RouteProvider.RJeq7SL2FhoyxG2xWh(Object , Object , Object , Boolean ) +20
SevenSpikes.Nop.Plugins.Core.RouteProvider.InstallMissingResources() +152
SevenSpikes.Nop.Framework.Routing.BaseRouteProvider.mWuLvl6oXHLoXInuiKG(Object ) +14
SevenSpikes.Nop.Framework.Routing.BaseRouteProvider.RegisterRoutes(RouteCollection routes) +177
Nop.Web.Framework.Mvc.Routes.<>c__DisplayClass3.<RegisterRoutes>b__1(IRouteProvider rp) +81
System.Collections.Generic.List`1.ForEach(Action`1 action) +14232564
Nop.Web.Framework.Mvc.Routes.RoutePublisher.RegisterRoutes(RouteCollection routes) +1014
Nop.Web.MvcApplication.RegisterRoutes(RouteCollection routes) +223
Nop.Web.MvcApplication.Application_Start() +366
[HttpException (0x80004005): An exception was thrown while executing a resolve operation. See the InnerException for details. ---> No database instance (See inner exception for details.)]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12949749
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): An exception was thrown while executing a resolve operation. See the InnerException for details. ---> No database instance (See inner exception for details.)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12966756
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12806561
The database exist. Why?
Thanks