Jas*_*lia 8 exception instance ravendb asp.net-mvc-3
我正在运行Windows 7 64位,RavenDB Embedded 1.0.701,MVC 3,C#,VS 2010 Pro.
按照RavenDB网站上的说明操作后,在asp.net页面的第一个RELOAD之后,我得到一个"无法打开事务存储:F:/ RavenDBDataStore/Data"内部异常"另一个数据库实例已经使用的临时路径"异常.
我尝试处理文档存储,但在我的视图中我得到了另一个例外.
public ActionResult Index()
{
EmbeddableDocumentStore documentStore = new EmbeddableDocumentStore { DataDirectory = "F:/RavenDBDataStore/" };
documentStore.Initialize(); // <--- this is were I get the exception after reloading the page
Dictionary<string, object> test = new Dictionary<string, object> {
{ "Name", 0 },
{ "Price", 3.99M },
{ "Expiry", new DateTime(2008, 12, 28) } ,
{ "Sizes", new string[] { "Small", "Medium", "Large" }}
};
var results = new Object();
using (IDocumentSession session = documentStore.OpenSession())
{
// Operations against session
session.Store(test);
session.SaveChanges();
ViewBag.Display = session.Advanced.GetDocumentId(test);
// Flush those changes
session.SaveChanges();
results = from c in session.Query<Dictionary<string, object>>()
select c;
}
return View(results);
}
Run Code Online (Sandbox Code Playgroud)
尝试按照此处描述的步骤进行操作:
特别注意管理会话部分...
如果您使用 IIS Express 来调试您的应用程序,请尝试在调试应用程序之前终止它...
| 归档时间: |
|
| 查看次数: |
2097 次 |
| 最近记录: |