运行RavenDB作为EmbeddableDocumentStore并访问RavenDB Management Studio

栏目: 数据库 · 发布时间: 5年前

内容简介:http://stackoverflow.com/questions/8112966/running-ravendb-as-an-embeddabledocumentstore-and-accessing-ravendb-management-s

我正在玩嵌入式RavenDB => RavenDB-Embedded.1.0.499软件包是通过NuGet在Visual Studio 2010中安装的.它正在使用我在阅读这个优秀的MSDN文章后开始的一个当前项目:

Embedding RavenDB into an ASP.NET MVC 3 Application

现在我想访问 RavenDB Management Studio (Web UI).

我按照这里描述的步骤: Is it possible to connect to an embedded DB with Raven Management Studio 和这里 Running RavenDB in embedded mode with HTTP enabled ,但我没有得到点.

这是我用来初始化DocumentStore的代码:

_documentStore = new EmbeddableDocumentStore
            {
                ConnectionStringName = "RavenDB",
                UseEmbeddedHttpServer = true
            };

这是Web.config中存在的ConnectionString:

<add name="RavenDB" connectionString="DataDir = ~\App_Data\Database" />

我也阅读了 RavenDB: Embedded Mode 中描述的步骤.我试图手动启动服务器:

// Start the HTTP server manually
var server = new RavenDbHttpServer(documentStore.Configuration,
documentStore.DocumentDatabase);

server.Start();

但上述代码似乎过时了,因为我没有RavenDbHttpServer,documentStore.Configuration和documentStore.DocumentDatabase.我设法找到Raven.Database.Server.HttpServer,但_documentStore中缺少其他对象.

所以问题是:

我如何点击Web UI可视化我的嵌入式数据库文档?我应该在浏览器地址栏中放置什么URL?

任何建议是赞赏.

编辑:我找到了一种让它上班的方法.正如我在博客文章中所描述的那样,它可能不是最好的方法,但它的工作:

RavenDB Embedded with Management Studio UI

注意:上述方法的一个缺点是我无法在我的应用程序中访问数据库,因为它被服务器打开后被锁定.这样我必须停止服务器,然后在浏览器中重新加载我的应用程序.

我希望RavenDB的大师有一个更好/正确的方法…只是让我们知道.

我从来没有手动运行服务器以访问管理工作室.在你的问题中我通常没有提到的只有几个步骤:

// Add the following line prior to calling documentStore.Initialize()
Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);

将Raven.Studio.xap复制到我的Web项目的根文件夹中.

当我的Web应用程序运行时,RavenDB Management Studio然后可以在 http://localhost:8080 访问.

http://stackoverflow.com/questions/8112966/running-ravendb-as-an-embeddabledocumentstore-and-accessing-ravendb-management-s


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

游戏的设计与开发

游戏的设计与开发

次世代工作室 / 人民交通出版社 / 2003-12 / 50.00元

一起来看看 《游戏的设计与开发》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具