【问题标题】:NEventStore with RavenDB in Embedded Mode嵌入式模式下带有 RavenDB 的 NEventStore
【发布时间】:2014-04-27 16:57:15
【问题描述】:

我正在尝试让 NEventStore (v4) 在嵌入式模式下与 RavenDB 一起使用。

我的连接字符串如下所示:

<add name="EventStore" connectionString="DataDir = ~\Data" />

在 Application_Start 中,我这样设置 Raven Store:

var documentStore = new EmbeddableDocumentStore
{
    ConnectionStringName = "EventStore"
};
documentStore.Initialize();

这在初始化任何事件存储代码之前运行。此时我可以使用 Raven 来保存文档。所以 Raven 正在工作。

对于 NEventStore,init 看起来像这样:

_store = Wireup.Init()
    .LogToOutputWindow()
    .UsingRavenPersistence("EventStore") 
    .InitializeStorageEngine()
    .UsingJsonSerialization()
    .Compress()
    .UsingSynchronousDispatchScheduler()
    .DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
    .Build();

当它运行时,我得到这个错误:

连接字符串名称:“EventStore”无法解析,未知 选项:'datadir'

在查看 (RavenDB) 源代码时,连接字符串解析器似乎不知道它正在读取嵌入式连接字符串。但我没有看到任何方式表明 NEventStore 将在嵌入式模式下使用 Raven。

【问题讨论】:

    标签: c# ravendb neventstore


    【解决方案1】:

    'DataDir' 选项仅适用于 EmbeddableDocumentStore。 NEventstore creates 一个 DocumentStore。据我所知,你不能改变这种行为。

    您可以做的是使用HTTP enabled 启动 Embedded RavenDB 并连接到 localhost。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-23
      • 1970-01-01
      • 1970-01-01
      • 2012-12-06
      • 1970-01-01
      相关资源
      最近更新 更多