Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9104165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:48:05+00:00 2026-06-17T01:48:05+00:00

I am using SignalR to post an object from the client to the server,

  • 0

I am using SignalR to post an object from the client to the server, the object contains a date property which sometimes has a UTC DateTime and sometimes a LOCAL DateTime (this is a separate issue in itself). What I have noticed is that whenever the date is a local time e.g. ‘2013-01-08T10:35:59.8484157+00:00’ I get a ‘could not convert string to DateTime’ error. Upon inspection it appears that the string which is trying to be parsed has lost the ‘+’ character from the time zone offset information which causes the conversion error. I am trying to understand how this character has been lost.

SignalR is correctly serializing the object to json, and encoding it, as the + character is encoded as %2B as can be seen in the body of the SignalR request

data=%7B%22H%22%3A%22alertshub%22%2C%22M%22%3A%22AcknowledgeAlert%22%2C%22A%22%3A%5B%7B%22Id%22%3A%22e2d65f79-6a03-4094-a00f-99fcd9b46a7a%22%2C%22StartDateTimeUtc%22%3A%222013-01-08T10%3A26%3A44.0849463%2B00%3A00%22%2C%22EndDateTimeUtc%22%3Anull%2C%22AcknowledgedDateTimeUtc%22%3Anull%2C%22Description%22%3A%22Test+Alert+17%22%7D%5D%2C%22I%22%3A0%7D

Running this via a UrlDecode function returns the correct values

data={
    "H":"alertshub",
    "M":"AcknowledgeAlert",
    "A":[{
            "Id":"e2d65f79-6a03-4094-a00f-99fcd9b46a7a",
            "StartDateTimeUtc":"2013-01-08T10:26:44.0849463+00:00",
            "EndDateTimeUtc":null,
            "AcknowledgedDateTimeUtc":null,
            "Description":"Test Alert 17"
    }],
    "I":0
}

But when looking at the SignalR request context the body has list the ‘+’, and is now a space. This causes the date conversion error. It appears that somewhere along the line SignalR/JSON.NET/.NET (not sure which one) is double decoding the posted data and turning the + into a space.

I have created a simple MVC application which demonstrates the issue, its up on GitHub http://github.com/davidthompson/SignalRPlusEncodingTest

Once the sample application is running click the acknowledge button next to any alerts with a UTC date it, this will call a SignalR method on the hub and the alert will disappear. If you perform the same action against an alert with a local date it will fail (click ‘Create new alert’ button, it will randomly generate an alert with either a UTC or LOCAL date). The browser console will show the error about the failed conversion. But in case that doesn’t the error received is below:

[10:36:04 GMT+0000 (GMT Standard Time)] SignalR: Could not convert string to DateTime: 2013-01-08T10:35:53.1401147 00:00. Path 'StartDateTimeUtc', line 1, position 144.
   at Newtonsoft.Json.JsonReader.ReadAsDateTimeInternal()
   at Newtonsoft.Json.Linq.JTokenReader.ReadAsDateTime()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Microsoft.AspNet.SignalR.JTokenValue.ConvertTo(Type type)
   at Microsoft.AspNet.SignalR.Hubs.DefaultParameterResolver.ResolveParameter(ParameterDescriptor descriptor, IJsonValue value)
   at System.Linq.Enumerable.<ZipIterator>d__7a`3.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.AspNet.SignalR.Hubs.DefaultParameterResolver.ResolveMethodParameters(MethodDescriptor method, IJsonValue[] values)
   at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.InvokeHubPipeline(IHub hub, IJsonValue[] parameterValues, MethodDescriptor methodDescriptor, HubRequest hubRequest, StateChangeTracker tracker)

jquery....min.js (line 10)

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:48:07+00:00Added an answer on June 17, 2026 at 1:48 am

    This was fixed in the latest dev branch of SignalR via issue https://github.com/SignalR/SignalR/issues/1194.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the SignalR Javascript client and ASP.NET ServiceHost. I need the SignalR hubs
I am using SignalR in my MVC3 application, and since I have implemented StructureMap
I am using the hub- feature of SignalR ( https://github.com/SignalR/SignalR ) to publish messages
I've got a problem trying to send a request using QNetworkAccessManager from a QObject
I want to POST data to a PHP form using this code, but after
We are designing a p2p applications using c++ which transmits voice to other peer
We have some html that looks like this: <form id=MyUserControl runat=server method=post> <script language=javascript
I'm currently developing an application and I'm using this post code to get the
Using Django 1.2, I'm running the django-registration application, and creating a User Profile object
I'm using SignalR to send messages in real time updates towards my clients. Receiving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.