底层提供程序在Open上失败。 SQL Compact Edition 4和EntityFrameWork 6,WindowsForm应用程序部署

时间:2015-08-26 17:56:30

标签: winforms sql-server-ce-4

我希望我能尽快得到专家的回答。

这是我的问题:

  

底层提供程序在Open上失败。

     

的EntityFramework
  在System.Data.Entity.Core.EntityClient.EntityConnection.Open()
  在System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
  at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction [T](Func 1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery
1.<> c__DisplayClass3.b__1()at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute [TResult] (Func 1 operation) at System.Data.Entity.Core.Objects.ObjectQuery 1.GetResults(Nullable 1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery 1..GetEnumerator> b__0()在System.Data.Entity.Internal.LazyEnumerator 1.MoveNext() at System.Collections.Generic.List 1..ctor(IEnumerable {{1}来自iSpyApplication.BLL.UserActivityLog.GetAllActivity()的1个来源)       System.Data.SqlServerCe.SqlCeException(0x80004005):路径无效。检查数据库的目录。位于System.Data.SqlServerCe.SqlCeConnection.Open()的System.Data.SqlServerCe.SqlCeConnection.Open(布尔静默)的[Path = D:\ SDB001.sdf],位于System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__36 (DbConnection t,DbConnectionInterceptionContext c)在System.Data.Entity.Infrastructure.Interception的System.Data.Entity.Infrastructure.Interception.InternalDispatcher 1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable 2操作,TInterceptionContext interceptionContext,Action 1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action 3执行)。 System.Data.Entity.Cent.EntityClient.Entity上的System.Data.Entity.Core.EntityClient.EntityConnection.b__2()中的DbConnectionDispatcher.Open(DbConnection连接,DbInterceptionContext interceptionContext)。在System.Data.Entity.Core的System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action操作) .EntityClient.EntityConnection.Open()       System.Collections.ListDictionaryInternal

我用来从数据库中获取数据的方法:

3 executing, Action

这是我的public static List<ActivityLog> GetAllActivity() { try { SEDMEntities context = new SEDMEntities(); List<ActivityLog> ag = (from m in context.ActivityLogs select m).ToList(); return ag; } catch (Exception ex) { MainForm.LogExceptionToFile(ex, "Exception While Getting the list of activities"); throw; } }

app.config

我按照以下链接执行了步骤1到7中的所有步骤: http://www.codeproject.com/Articles/180734/Using-the-Microsoft-Desktop-Stack-Part-Setting-u

以下是有关我的环境和操作系统的更多详细信息。

  • Windows 8.1 x64
  • Visual Studio 2013 Ultimate
  • ASP.NET 4 Windows窗体应用程序
  • SQL Server CE 4
  • 实体框架6

如果您需要我的任何进一步细节,请告诉我。

当我使用VS2013调试器运行代码时,我的机器上的一切正常。

但是当我进行设置时,会出现上述错误。

0 个答案:

没有答案