Hello. We are using self-hosted service using Topshelf and Nancy. The service communicates with in-memory Event Store database. When switching to IIS hosting (using Nancy.Hosting.Aspnet) the application hangs when entering IEventStoreConnection.ConnectAsync() method. It uses the same code that is being used for connection from self-hosted environment.
We also noticed that after ConnectAsync() call the Event Store logs the connection (External TCP connection accepted) although it doesn’t return.
Can IIS affect the client connection in any way?
Are there any known issues integrating with IIS?
Is there something we are missing?
The code used for the connection:
var eventStoreConnection = EventStoreConnection.Create(ConnectionSettings.Create().KeepReconnecting().KeepRetrying().Build(), url);
await eventStoreConnection.ConnectAsync();
We tried the below code and it worked. Any ideas why it doesn’t work with await eventStoreConnection.ConnectAsync() and why the problem only occurs when hosted under IIS? It doesn’t seem to make much sense.
var eventStoreConnection = EventStoreConnection.Create(ConnectionSettings.Create().KeepReconnecting().KeepRetrying().Build(), url);
var task = eventStoreConnection.ConnectAsync();
await task;
return eventStoreConnection;
I tried it. When stepping into the code I’m able to continue to the return eventStoreConnection statement getting the impression that it works however the application still hangs. At the moment it looks like the only thing that works is storing the task in a variable and then awaiting it.