SignalR/SignalR — Issue #158: Serializing objects that contain &
Author: DaveSussman
Created: 2012-01-30 09:03:22+00:00
State: open

I can't believe this is a bug, it seems so obvious that it slipped through, but I've an issue with messages sent over a persistent connection from a console app to the web site, where the message contains the ampersand. When the message gets into OnReceivedAsync, the data is truncated at the &. My data string is a serialized object, thus deserialization fails due to an unterminated string.

I've uploaded a sample project to illustrate this behaviour: https://skydrive.live.com/redir.aspx?cid=635c8e2bf4822d7c&resid=635C8E2BF4822D7C!502&parid=635C8E2BF4822D7C!440&authkey=!AOPKo4Rhmgv1Ds4

It's a standard MVC project containing the connection, with a simple network server (console app) that pushes a message to the connection. To repro:

1. Run MVC app to start server and connection. Navigate to /Events. There's nothing in the page as yet.
2. Set a breakpoint in OnReceivedAsync.
3. Run Network.Server.exe from Network.Server\bin\Debug. Hit return to send the message.
4. On the breakpoint, examine the data string. You'll see the string is truncated.

So, is this a bug, or have I missed something obvious.

Thanks

d