2

このチュートリアルに従って、ravenDb を永続化オブジェクトとして使用しています。

コントローラーで渡された値を保存しようとしたときに、次のエラーが発生しました

> No connection could be made because the target machine actively
> refused it 127.0.0.1:8080

Global.asax.cs

public class MvcApplication : System.Web.HttpApplication
{
   public static IDocumentStore RavenDBDocumentStore { get; private set; }
   private static void CreateRavenDBDocumentStore()
   {
      RavenDBDocumentStore = new DocumentStore
      {     
         ConnectionStringName = "ravenDB"
      }.Initialize();
   }
   protected void Application_Start()
   {
      ...
      CreateRavenDBDocumentStore();
   }
}

8081またはでポート番号を変更してみまし8085たが、どちらの方法でもエラーメッセージは同じです。

これが私の接続文字列セクションです

 <connectionStrings>    
      <add name="DefaultConnection"
         providerName="System.Data.SqlClient"
         connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-RavenMvc-20121125145005;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-RavenMvc-20121125145005.mdf" />
         <add name="ravenDB"
         connectionString="Url=http://localhost:8085"/> 
  </connectionStrings>

Raven サーバーが開始された後は、すべて問題ありません。

4

1 に答える 1

2

RavenDB サーバーが実行中で、アプリケーションと同じポートを使用していることを確認する必要があります。

接続文字列では、接続するサーバーのポートを指定しますが、RavenDB サーバー自体を実行していない可能性があります。

于 2013-05-29T07:43:08.250 に答える