asp.net-mvc-3 – 另一个数据库实例RavenDB MVC3已经使用的临时路径

前端之家收集整理的这篇文章主要介绍了asp.net-mvc-3 – 另一个数据库实例RavenDB MVC3已经使用的临时路径前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在运行 Windows 7 64位,RavenDB Embedded 1.0.701,MVC 3,C#,VS 2010 Pro.

按照RavenDB网站上的说明操作后,在asp.net页面的第一个RELOAD之后,我得到一个“无法打开事务存储:F:/ RavenDBDataStore / Data”内部异常“另一个数据库实例已经使用的临时路径”异常.

我尝试处理文档存储,但在我看来我得到了另一个例外.

  1. public ActionResult Index()
  2. {
  3. EmbeddableDocumentStore documentStore = new EmbeddableDocumentStore { DataDirectory = "F:/RavenDBDataStore/" };
  4. documentStore.Initialize(); // <--- this is were I get the exception after reloading the page
  5. Dictionary<string,object> test = new Dictionary<string,object> {
  6. { "Name",0 },{ "Price",3.99M },{ "Expiry",new DateTime(2008,12,28) },{ "Sizes",new string[] { "Small","Medium","Large" }}
  7. };
  8.  
  9. var results = new Object();
  10. using (IDocumentSession session = documentStore.OpenSession())
  11. {
  12. // Operations against session
  13. session.Store(test);
  14. session.SaveChanges();
  15. ViewBag.Display = session.Advanced.GetDocumentId(test);
  16. // Flush those changes
  17. session.SaveChanges();
  18.  
  19. results = from c in session.Query<Dictionary<string,object>>()
  20. select c;
  21. }
  22. return View(results);
  23. }

解决方法

尝试按照此处描述的步骤操作:

Using RavenDB in an ASP.NET MVC website

特别关注管理会议部分……

如果您使用IIS Express调试应用程序,请在调试应用程序之前尝试将其删除

猜你在找的asp.Net相关文章