2016-07-11 21 views
1

私はつい最近のVisual Studio 2015診断ツールのエラーNewtonsoft.Json.JsonReaderException:値の解析中に予期しない文字が検出されました:<。 <:値を解析中に予期しない文字が発生しました:パス「」は、行0、位置0

Newtonsoft.Json.JsonReaderExceptionのための私の診断ツールでエラーになってきました。パス0、行0、位置0を返します。

ツールのログ出力を有効にし、ツールが要求を発行した直後にエラーが発生するため、以下のstacktraceがDataWarehouseRestWebHostと関係しているように見えます

System.AggregateException: One or more errors occurred. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. 
    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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) 
    at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) 
    at Microsoft.DiagnosticsHub.VisualStudio.DataWarehouseRestWebHost.<ProcessErrorResponse>d__8.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
    at Microsoft.DiagnosticsHub.VisualStudio.DataWarehouseRestWebHost.<Request>d__7.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.DiagnosticsHub.VisualStudio.DataWarehouse.DataWarehouseInstance.<InitializeDataWarehouseInternal>d__52.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.DiagnosticsHub.VisualStudio.Collectors.CollectorService.StandardClientCollector.<OnStartCollection>d__27.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) 
    at Microsoft.DiagnosticsHub.VisualStudio.Runtime.PerformanceDebuggerSession.<StartCollectionAsync>d__13.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.DiagnosticsHub.Sessions.SessionBase.<>c__DisplayClass51_0.<<ContinueCurrentTaskWith>b__0>d.MoveNext() 
--- End of inner exception stack trace --- 
---> (Inner Exception #0) Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. 
    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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) 
    at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) 
    at Microsoft.DiagnosticsHub.VisualStudio.DataWarehouseRestWebHost.<ProcessErrorResponse>d__8.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() 
    at Microsoft.DiagnosticsHub.VisualStudio.DataWarehouseRestWebHost.<Request>d__7.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.DiagnosticsHub.VisualStudio.DataWarehouse.DataWarehouseInstance.<InitializeDataWarehouseInternal>d__52.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.DiagnosticsHub.VisualStudio.Collectors.CollectorService.StandardClientCollector.<OnStartCollection>d__27.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) 
    at Microsoft.DiagnosticsHub.VisualStudio.Runtime.PerformanceDebuggerSession.<StartCollectionAsync>d__13.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.DiagnosticsHub.Sessions.SessionBase.<>c__DisplayClass51_0.<<ContinueCurrentTaskWith>b__0>d.MoveNext() 

答えて

1

逆回答ですが、他の人に役立つかもしれません。 フォームの投稿パラメータの"URL ENCODE"をFalseに設定することで、この問題を解決しました。

これは、jsonフォームのポストパラメータをhtmlエンコードする必要がないためです。

関連する問題