2013-10-21 21 views
1

這裏的示例代碼:我試圖初始化烏鴉分貝時會發生存取錯誤

private static Raven.Client.Embedded.EmbeddableDocumentStore _documentStore; 
     public static Raven.Client.Embedded.EmbeddableDocumentStore documentStore 
     { 
      get 
      { 
       if (_documentStore == null) 
       { 
        _documentStore = new Raven.Client.Embedded.EmbeddableDocumentStore 
        { 
         DataDirectory = "App_Data/RavenDbData", 
         UseEmbeddedHttpServer = true 
        }; 
        _documentStore.Initialize(); 
       } 
       return _documentStore; 
      } 
     } 

異常消息looke這樣當_documentStore.Initialize();線被稱爲:

System.Net.HttpListenerException:該進程無法訪問該文件,因爲它正被另一個進程

+0

我這個頁面上找到(http://www.lansweeper.com/kb/HttpListenerException.aspx )它需要改變IP地址。我不知道如何爲ravendb做到這一點。 – BraveNewMath

回答

1

事實證明,如果8080端口使用此異常得到投擲還要別的嗎。此修復程序是該位添加到Web.config更改端口號(選擇任何端口號)

<appSettings> 
    <add key="Raven/Port" value="8082"/> 
    </appSettings> 
相關問題