You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code from your tutorial "TCP SDK 5.0.11 (.NET) - Connecting to EventStoreDB - Quick start" doesn't work. I have an error:
EventStore.ClientAPI.Exceptions.ConnectionClosedException: ‘Connection ‘ES-f2cffa2d-a4cc-4850-9976-0113bd272a81’ was closed.’
My code:
using EventStore.ClientAPI;
using System.Text;
var conn = EventStoreConnection.Create(new Uri("tcp://admin:changeit@localhost:1113"));
await conn.ConnectAsync();
var data = Encoding.UTF8.GetBytes("{\"a\":\"2\"}");
var metadata = Encoding.UTF8.GetBytes("{}");
var evt = new EventData(Guid.NewGuid(), "testEvent", true, data, metadata);
await conn.AppendToStreamAsync("test-stream", ExpectedVersion.Any, evt);
var streamEvents = await conn.ReadStreamEventsForwardAsync("test-stream", 0, 1, false);
var returnedEvent = streamEvents.Events[0].Event;
Console.WriteLine(
"Read event with data: {0}, metadata: {1}",
Encoding.UTF8.GetString(returnedEvent.Data),
Encoding.UTF8.GetString(returnedEvent.Metadata)
);
The text was updated successfully, but these errors were encountered:
EventStore v21.10.8
.NET 7
The code from your tutorial "TCP SDK 5.0.11 (.NET) - Connecting to EventStoreDB - Quick start" doesn't work. I have an error:
EventStore.ClientAPI.Exceptions.ConnectionClosedException: ‘Connection ‘ES-f2cffa2d-a4cc-4850-9976-0113bd272a81’ was closed.’
My code:
The text was updated successfully, but these errors were encountered: