執行RavenDB作為EmbeddableDocumentStore並訪問RavenDB Management Studio
我正在玩嵌入式RavenDB => RavenDB-Embedded.1.0.499軟體包是通過NuGet在Visual Studio 2010中安裝的.它正在使用我在閱讀這個優秀的MSDN文章後開始的一個當前專案:
ofollow,noindex" target="_blank">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