Question

I'm playing with an embedded RavenDB => RavenDB-Embedded.1.0.499 package installed via NuGet in Visual Studio 2010. It's being used in a current project that I started after reading this excellent MSDN article:

Embedding RavenDB into an ASP.NET MVC 3 Application

Now I'd like to access the RavenDB Management Studio (Web UI).

I followed the steps described here: Is it possible to connect to an embedded DB with Raven Management Studio and here Running RavenDB in embedded mode with HTTP enabled but I didn't get the point.

This is the code I'm using to initialize the DocumentStore:

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

and this is the ConnectionString present in Web.config:

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

I also read the steps described in RavenDB: Embedded Mode. I tried to start the server manually:

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

server.Start();

but the above code seems outdated since I have no RavenDbHttpServer, documentStore.Configuration and documentStore.DocumentDatabase. I managed to find Raven.Database.Server.HttpServer but the other objects are missing in the _documentStore.

So, the question is:

How can I hit the Web UI to visualize my embedded database docs? What's the URL I should put in my browser address bar?

Any advice is appreciated.

EDIT: I've found a way of getting it to work. As I described in my blog post it may not be the best approach but it does work:

RavenDB Embedded with Management Studio UI

Note: one downside of the above approach is that I'm not able to access the database in my app because once it has been opened by the server it gets locked. This way I have to stop the server and then reload my app in the browser.

I hope RavenDB's gurus out there have a better/correct approach... just let us know.

Was it helpful?

Solution

I've never had to run the server manually in order to access the management studio. The only few steps that haven't been mentioned in your question that I usually do:

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

Copy Raven.Studio.xap into the root folder of my web project.

When my web application is running, the RavenDB Management Studio is then accessible at http://localhost:8080.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top