ServerEventsClient System.Numerics.Vectors loading error

Just starting to use SSE with the C# Client. I am using the code seen in the doc (using my own request DTO) and when I call client.ServiceClient.Post, I get this error:
Could not load file or assembly ‘System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies.
I can trap the error and the little console app seems to work ok, sending heartbeats but still…Where that error come from?

I am using the latest version of ServiceStack and .net 4.8

var client = new ServerEventsClient(baseUri, channel=“Home”);

// Wait to receive onConnect event
ServerEventConnect connectMsg = await client.Connect();

// Wait to receive onJoin command event
ServerEventCommand joinMsg = await client.WaitForNextCommand();

// Hold a future task to get notified once a msg has been received
Task msgTask = client1.WaitForNextMessage();

// Send a Web Service Request using the built-in JsonServiceClient
client.ServiceClient.Post(new PostChatToChannel {
Channel = client.Channel, // The channel we’re listening on
From = client.SubscriptionId, // Populated after Connect()
Message = “Hello, World!”,
});

// Wait till we receive the chat Msg event we sent earlier
ServerEventMessage msg = await msgTask;

ok. I found it. This has nothing to do with the ServerEventsClient.
The problem is with my request DTO. I get the error because of the RealTime property. Somehow, the bool type is messing everything up…As soon as I comment that property, everything is fine.

I just don’t get it…

[Route("/api/v1/sse/{Channel}", “GET,POST”)]
public class SseRequest:IReturn
{
public string DataPointId { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public int Interval { get; set; }
public string RelativeTime { get; set; }
public string Channel { get; set; }
public bool RealTime { get; set; }
}

1 Like

These dependency issues are annoying, some things you can try are published at https://docs.servicestack.net/templates-corefx#troubleshooting

Oh my God. Finally solved it. Had to do a big cleanup of all packages, many of them not necessary, I had some .net core stuff not needed. Anyway, works now. What a pain…
Thanks for the help.

1 Like