|
嗨,我试图运行我的MVC 3应用程序,该应用程序运行SQLCE 4 Embedded和EF4.1
( p& }& h: t8 w+ o$ C我已经使用了本教程中描述的数据访问方法
3 b# D! V3 H3 |9 M这在本地完美地工作(显然),但是在我的主机上运行它时,出现以下错误消息。这是一个共享的托管环境。
0 l1 v# q& r, J# }( u5 `6 d* I0 Z4 H问题是开放的连接吗?它是否应该由工作单元类处理,该工作单元类按教程中所述在整个应用程序中以单例形式返回dbcontext?
6 o$ a5 {8 x8 N" g; w2 J关于这可能由什么引起的任何提示将不胜感激
. o( X6 x/ o1 G1 f+ I" ?内部错误:无法打开共享内存区域。* m+ u! ^0 N" Q# h
说明:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。
* o+ V& F3 r* Q: X4 j' x/ Y( ?0 F* Z# O2 [9 s" @$ {
异常详细信息:System.Data.SqlServerCe.SqlCeException:内部错误:无法打开共享内存区域。
8 ~- |9 D+ t; z4 a/ k
* E- \( Z. b! A% k/ F源错误:
# l+ ^0 h. I& r" M当前Web请求的执行期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息。4 ^1 ], o( O; u- D/ U( h
堆栈跟踪:) q, t+ u! H6 U& Z$ Y
[SqlCeException (0x80004005): Internal error: Cannot open the shared memory region.]& l$ b, g9 P4 q& }, H! f ^
System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr) +40
2 h6 X: {8 t3 S5 `5 H. M System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent) +2542
: q6 U4 f6 @3 T: H( A System.Data.SqlServerCe.SqlCeConnection.Open() +113& x. k- ]% R# O2 Q1 w
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +67" u! A( O# W( X3 R0 I! m. v6 J
[EntityException: The underlying provider failed on Open.]
% n# l: x0 |# a System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +109751501 z5 G0 T- D- r& _0 W; `# I
System.Data.EntityClient.EntityConnection.Open() +1423 J2 L8 ]2 j( `1 N
System.Data.Objects.ObjectContext.EnsureConnection() +97
+ c3 W ^/ W3 A System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +66
5 [6 \0 L; \7 m6 \2 V System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator() +47 c- H( J9 w+ {) v; L/ \% x
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +220
# B+ P6 W& {# B/ X0 U System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +383
$ l3 b# R$ w5 ]% { System.Data.Entity.Internal.InternalContext.QueryForModelHash() +349, c9 j+ W7 F2 E/ {$ _
System.Data.Entity.Internal.InternalContext.CompatibleWithModel(Boolean throwIfNoMetadata) +109# I- X/ d6 u2 w
System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context) +373) p$ ~5 U% [& O# [, _) z0 |! H+ l; A7 Q
System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +64
1 s5 Q' b3 ~" Q5 T/ `8 Y5 [[DataException: An exception occurred while initializing the database. See the InnerException for details.]
3 T6 ]$ O( d4 o ]8 o4 J8 z/ ` System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +152
4 z v8 a7 ?3 | z8 j$ d System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +199
5 ^5 Q# Y* _. Y; H* n! j+ T System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +193
, J( j o+ F+ V8 G. B+ P System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +235
# l1 R$ k6 z3 X' i& `7 M System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +38
+ l" G8 Y. I8 y4 S6 b System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +890 j1 k Q! h4 o& b; `: s0 N' p, s
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
* m. ^3 w1 E/ X1 V2 f# s% b# F System.Data.Entity.Internal.Linq.InternalSet`1.Find(Object[] keyValues) +37% h% Q% C* T( W( I- l7 B
Web.Infrastructure.DataAccess.Repository`1.GetByID(Object id) +131
+ K1 O8 J, V& }& y: h Web.Controllers.PagesController.Home() +154
$ V3 U5 y, L) I5 i0 f0 ] lambda_method(Closure , ControllerBase , Object[] ) +796 _8 t* ^9 I& j0 q! A
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +2642 a! P# |: R) y0 v( q' q, j
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
9 M0 N, }! W" A3 Y System.Web.Mvc.c__DisplayClass15.[I]b__12() +129- \3 B6 _8 z% M! X2 S
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +784922
5 Z9 T% P: U3 b+ I2 e System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +314
5 b9 f. `5 P* o0 j1 M( W System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +784976! z( B; _ j6 v
System.Web.Mvc.Controller.ExecuteCore() +159. u( _# {4 E- w3 r4 i7 a: z* Y7 L
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +3353 ?7 s; ]# c% h, `9 G7 H% Y
System.Web.Mvc.c__DisplayClassb.[B]b__5() +62# T9 @0 d @9 R& P: F/ X. V
System.Web.Mvc.Async.c__DisplayClass1.b__0() +20
1 N) v( f$ W& D' I8 _& K \ System.Web.Mvc.c__DisplayClasse.b__d() +54, O* E/ ^4 b% U" d
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453
4 }2 w1 y. v2 E" U3 {4 |0 u: |9 E& L System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371$ O8 W1 ~5 M: C# x% j+ q% S
8 y4 Y% U( n- ]+ ~# |0 k
解决方案: |
|