1

Here's sample code:

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;
            }
        }

The exception message looke like this when the _documentStore.Initialize(); line is called:

System.Net.HttpListenerException: The process cannot access the file because it is being used by another process

BraveNewMath
  • 8,090
  • 5
  • 46
  • 51
  • i found on this page (http://www.lansweeper.com/kb/HttpListenerException.aspx) that it has to do with needing to change the ip address. I don't know how to do that for ravendb. – BraveNewMath Oct 21 '13 at 06:54

1 Answers1

1

It turns out that this exception gets thrown if port 8080 is used by anything else. The fix was to add this bit to the web.config to change the port number (pick any port number)

  <appSettings>
    <add key="Raven/Port" value="8082"/>
  </appSettings>
BraveNewMath
  • 8,090
  • 5
  • 46
  • 51