The tutorial for .NET is wrong

I downloaded EventStoreDb, run:
EventStore.ClusterNode.exe --insecure

I created a console application:
using EventStore.ClientAPI;
using System.Text;

var connection = EventStoreConnection.Create(
    new Uri("tcp://admin:changeit@localhost:1113")
await connection.ConnectAsync();

const string streamName = "newstream";
const string eventType = "event-type";
const string data = "{ \"a\":\"2\"}";
const string metadata = "{}";

var eventPayload = new EventData(
    eventId: Guid.NewGuid(),
    type: eventType,
    isJson: true,
    data: Encoding.UTF8.GetBytes(data),
    metadata: Encoding.UTF8.GetBytes(metadata)
var result = await connection.AppendToStreamAsync(streamName, ExpectedVersion.Any, eventPayload);

And I have an exception:
EventStore.ClientAPI.Exceptions.ConnectionClosedException: ‘Connection ‘ES-f2cffa2d-a4cc-4850-9976-0113bd272a81’ was closed.’

And what now??

if you want to use the TCP proctocol , you have to enable the TCP protocol explicitely like this if you’re not starting from one of the provided docker compose file
Throught the command line :
EventStore.ClusterNode.exe --insecure --enableexternaltcp

mind that the TCP protocol is deprecated and we encourage people to use the gRPC clients :

That’s also what I wrote in the issue. I would suggest using one channel instead of all of them.

The page you copied the code from shows this on the top

OK, now I am using gRPC and it works but you should add to your tutorial a connection string:

I didn’t know what connection string I should have used. This was the reason why I tried with TCP.

You can generate the connection string on the gRPC clients documentation landing page. When it’s done, you get the connection string populated in the samples.

This generator is too complicated for me.
Please simply add:


to the documentation

Could you elaborate the “too complicated” part? You need to click on Node URL, type localhost and click Fetch configuration. If you have the node running in Docker, it will work.

Oh :open_mouth: thank you