Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用实体框架缺少SQLite和SQL Server CE数据库文件_C#_Entity Framework_Sqlite_Sql Server Ce - Fatal编程技术网

C# 使用实体框架缺少SQLite和SQL Server CE数据库文件

C# 使用实体框架缺少SQLite和SQL Server CE数据库文件,c#,entity-framework,sqlite,sql-server-ce,C#,Entity Framework,Sqlite,Sql Server Ce,我首先使用实体框架代码,我的数据库文件显然没有被创建,至少没有在磁盘上。我可以用我的程序使用数据库,一切都很好,唯一的问题是我自己找不到数据库文件,我想用它进行调试 这是我的DbContext类: public class HelperEntities : DbContext { public HelperEntities() : base("HelperEntities") { } public DbSet<GuidModel> Guids { g

我首先使用实体框架代码,我的数据库文件显然没有被创建,至少没有在磁盘上。我可以用我的程序使用数据库,一切都很好,唯一的问题是我自己找不到数据库文件,我想用它进行调试

这是我的
DbContext
类:

public class HelperEntities : DbContext
{
        public HelperEntities() : base("HelperEntities") { }

        public DbSet<GuidModel> Guids { get; set; }
}
公共类帮助属性:DbContext
{
公共HelperEntities():base(“HelperEntities”){}
公共DbSet Guids{get;set;}
}
连接字符串:

<add name="HelperEntities" connectionString="Data Source=NewDatabase.sdf;Encrypt Database=True;Password:nopassword1;" providerName="System.Data.SqlServerCe" />


SQL Server Compact Edition和SQLite都会出现这种情况,请在bin/debug文件夹中查找!最好的方法是在连接字符串中拥有数据库文件的完整路径。它不在生成文件夹中,即使我将特定文件夹指定为“C:\database.sdf”,它也不会在那里。它可能在您的用户配置文件文件夹中(Windows 7
C:\Users\username
)。