加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 04:28:31 所属栏目:asp.Net 来源:网络整理
导读:我正在运行 Windows 7 64位,RavenDB Embedded 1.0.701,MVC 3,C#,VS 2010 Pro. 按照RavenDB网站上的说明操作后,在asp.net页面的第一个RELOAD之后,我得到一个“无法打开事务存储:F:/ RavenDBDataStore / Data”内部异常“另一个数据库实例已经使用的临时路径
我正在运行 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);
}

解决方法

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

Using RavenDB in an ASP.NET MVC website

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读