2

最近、パッケージマネージャーRavenDBを介して(一連のアセンブリ:クライアント、データベース、組み込み)をインストールしました。NuGet私は次のように構成DocumentStoreしました:

public override void Load()
{
    Bind<IDocumentStore>().ToMethod(
        context => {
            var documentStore = new EmbeddableDocumentStore { 
                Url = "http://localhost:8080", 
                DefaultDatabase = "ampDatabase",
                UseEmbeddedHttpServer = true
            };
            return documentStore.Initialize();
        }
    ).InSingletonScope();

    Bind<IDocumentSession>().ToMethod(context => 
        context.Kernel.Get<IDocumentStore>().OpenSession()
    ).InRequestScope();
}

このコードが呼び出された後:

documentSession.Store(idea);
documentSession.SaveChanges();

私は得ていSystem.Net.Sockets.SocketExceptionます:

ターゲットマシンが積極的に拒否したため、接続できませんでした127.0.0.1:8080

私は何を逃しましたか?

4

1 に答える 1

2

次のように設定します。

 var documentStore = new EmbeddableDocumentStore { 
                Url = "http://localhost:8080", 
                DefaultDatabase = "ampDatabase",
                UseEmbeddedHttpServer = true
            };

問題は、これが実際には埋め込みモードを使用せず、サーバークライアントの方法で処理を試みるように指示していることです。次のように変更します。

 var documentStore = new EmbeddableDocumentStore { 
                DataDirectory = "Database",
                UseEmbeddedHttpServer = true
            };

そしてそれはうまくいくでしょう

于 2012-06-24T04:58:32.517 に答える