Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.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# ESENT数据库引擎文件访问被拒绝_C#_.net_Esent - Fatal编程技术网

C# ESENT数据库引擎文件访问被拒绝

C# ESENT数据库引擎文件访问被拒绝,c#,.net,esent,C#,.net,Esent,我正在尝试将ESENT windows数据库与库一起使用,但总是出现错误 Error FileAccessDenied (JET_errFileAccessDenied, Cannot access file, the file is locked or in use) 打开数据库的代码是 m_Dictionary = new PersistentDictionary<string, PropertyStruct>("BaseEstateCachedPropertySummary2

我正在尝试将ESENT windows数据库与库一起使用,但总是出现错误

Error FileAccessDenied (JET_errFileAccessDenied, Cannot access file, the file is locked or in use)
打开数据库的代码是

m_Dictionary = new PersistentDictionary<string, PropertyStruct>("BaseEstateCachedPropertySummary2");
m_Dictionary=new PersistentDictionary(“baseStateCachedPropertySummary2”);

我正在Windows7上测试这个应用程序,它是一个ASP.NET应用程序。是否有人对此有任何想法,文档非常少。

您是否试图打开其他服务(例如Windows Update数据库)使用的现有数据库?Esent数据库只是一个进程,因此您必须停止使用同一数据库的任何其他进程。

我找到了答案。显然,我没有对放置数据库的默认目录的写入权限,因此我必须指定完整路径,例如

m_Dictionary = new PersistentDictionary<string, PropertyStruct>(@"c:\Data\BaseEstateCachedPropertySummary2");
m_Dictionary=new PersistentDictionary(@“c:\Data\baseStateCachedPropertySummary2”);

我不想打开这样的现有数据库。我已经在上面添加了代码。