How could I make my RavenDB application execute properly when UseEmbeddedHttpServer is set to true using 2-tier architecture?

前端 未结 2 1483
终归单人心
终归单人心 2021-01-31 14:08

I used RavenDB-Embedded 2.0.2230 in my application interacted with ASP .Net Web API in different assemblies.

When I set UseEmbeddedHttpServer = tr

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-31 14:41

    When you enable the HttpServer in an EmbeddableDocumentStore ravenDB "hijacks" the webapplication and starts listening on the same port that the application is running.

    Oren Eini: When you use UseEmbeddedHttpServer from inside IIS, it takes the port from IIS. You need to set the value again

    on https://groups.google.com/forum/?fromgroups=#!topic/ravendb/kYVglEoMncw

    The only way to prevent it is either turn-ff the raven http-server or assign it to a different port

    int ravenPort = 8181;
    NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(ravenPort);
    var ds = new EmbeddableDocumentStore {
       DataDirectory = [DataFolder],    
       UseEmbeddedHttpServer = true,    
       Configuration = {Port = ravenPort}
    };
    

提交回复
热议问题