如何在共享托管环境中运行RavenDB?

RavenDB能够以“嵌入式”模式运行,据我所知,它应该允许它在共享托管环境中运行。

有没有人知道它如何在ASP.NET MVC应用程序中工作,以及这样做的最佳实践是什么?

托管环境中是否存在我需要注意的依赖关系?

是。

我使用ASP.NET MVC 3和RavenDB 1.0.0.371在共享托管环境http://www.winhost.com/中运行RavenDB,该版本于2011年7月左右发布。

我的代码:

public static class Store { private static IDocumentStore store = createStore(); private static EmbeddableDocumentStore createStore() { var returnStore = new EmbeddableDocumentStore(); returnStore.DataDirectory = @"./PersistedData"; returnStore.Initialize(); return returnStore; } public static xxx Read(string key) { using (var session = store.OpenSession()) { var anEntity = session.Query(). Where(item => item.key == key).Single(); return anEntity; } } public static void Write(xxx) { using (var session = store.OpenSession()) { session.Store(xxx); session.SaveChanges(); } } } 

到目前为止唯一的缺点是我没有得到RavenDB管理工作室。