I’m having troubles creating a projection via the EventStore.ClientApi.Projections.ProjectionManager class.
Here’s the error:
System.AggregateException: One or more errors occurred. (An error occurred while sending the request.)
—> System.Net.Http.HttpRequestException: An error occurred while sending the request.
—> System.Net.Http.WinHttpException: The server returned an invalid or unrecognized response
EventStore version is 4.1.1-hotfix1-1
EventStore.ClientApi version is 4.1.0.23
Here’s the code including the projection query. I’m able to use exactly the same projection query text successfully while creating the projection in the web UI.
Is there a problem using “linkTo” in the methods provided by the ProjectionManager?
I noticed that while an overload of the CreateContinuousAsync method includes a parameter for “trackEmittedStreams”, there is no available parameter for “emitEnabled”
var projectionName = “LinkedEventsTest”;
var projectionQuery = @“fromStream(‘linkedEventSource’).when({’$any’:function(s,e){linkTo(‘linkedEventSink’, e, {‘meta’:‘data’});}})”;
var credentials = new global::EventStore.ClientAPI.SystemData.UserCredentials(EventStoreOptions.UserName, EventStoreOptions.Password);
var projectionsManager = new global::EventStore.ClientAPI.Projections.ProjectionsManager(Log.AsEventStoreLogger(), EventStoreOptions.IPEndPoint, EventStoreOptions.OperationTimeout);
await projectionsManager.CreateContinuousAsync(projectionName, projectionQuery, true, credentials);
Thanks in advance for your advice,
Ben