“/”应用程序中的服务器错误。

No database instance

说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.ApplicationException: No database instance

源错误:

执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[ApplicationException: No database instance]
   Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context) in D:\UYIDA\Libraries\Nop.Data\Initializers\CreateTablesIfNotExist.cs:69
   System.Data.Entity.Internal.<>c__DisplayClassf`1.<CreateInitializationAction>b__e() +76
   System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60
   System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +395
   System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +11
   System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +110
   System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +214
   System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +97
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +53
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +16
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +39
   System.Linq.Queryable.OrderBy(IQueryable`1 source, Expression`1 keySelector) +83
   Nop.Services.Stores.StoreService.<GetAllStores>b__9_0() in D:\UYIDA\Libraries\Nop.Services\Stores\StoreService.cs:97
   Nop.Core.Caching.CacheExtensions.Get(ICacheManager cacheManager, String key, Int32 cacheTime, Func`1 acquire) in D:\UYIDA\Libraries\Nop.Core\Caching\Extensions.cs:39
   Nop.Core.Caching.CacheExtensions.Get(ICacheManager cacheManager, String key, Func`1 acquire) in D:\UYIDA\Libraries\Nop.Core\Caching\Extensions.cs:20
   Nop.Services.Stores.StoreService.GetAllStores() in D:\UYIDA\Libraries\Nop.Services\Stores\StoreService.cs:95
   Nop.Web.Framework.WebStoreContext.get_CurrentStore() in D:\UYIDA\Presentation\Nop.Web.Framework\WebStoreContext.cs:85
   Nop.Core.WebHelper.GetStoreHost(Boolean useSsl) in D:\UYIDA\Libraries\Nop.Core\WebHelper.cs:294
   Nop.Core.WebHelper.GetStoreLocation(Boolean useSsl) in D:\UYIDA\Libraries\Nop.Core\WebHelper.cs:368
   Nop.Core.WebHelper.GetStoreLocation() in D:\UYIDA\Libraries\Nop.Core\WebHelper.cs:356
   Nop.Web.MvcApplication.Application_BeginRequest(Object sender, EventArgs e) +220
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.2106.0