I am trying to create a signalR hub in asp.net but i have problems with it on server. It works ok on my local machine. The error i get it:
Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
The code is:
var hubConnection = new HubConnection("http://server_name/appName/");
hubConnection.Start().Wait();
I can see that the hubConnection url is correct because it's the same as the one provided in the constructor, which means: http://server_name/appName/signalr/
The full stacktrace is:
at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonTextReader.ReadInternal() at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value) at Microsoft.AspNet.SignalR.Client.Transports.TransportHelper.b__1(String raw) at Microsoft.AspNet.SignalR.TaskAsyncHelper.<>c__DisplayClass19
2.<Then>b__17(Task
1 t) at Microsoft.AspNet.SignalR.TaskAsyncHelper.TaskRunners2.<>c__DisplayClass42.<RunTask>b__41(Task
1 t)
Also, on IIS i don't have forms authentication, only the Anonymous Authentication is enabled.
PS: i have read the other questions related to this but none of them applies here. (the questions i've read are: this, this and this)