CloudBlockBlob.DownloadTextAsync returns invalid text
After further investigation, I found that the downloaded file has an extra Unicode formatting character at the start. I added the following code to just check for special characters at the beginning and remove them...
var startIndex = 0;while (char.GetUnicodeCategory(text, startIndex) == UnicodeCategory.Format){ startIndex++;}text = text.Substring(startIndex, text.Length - startIndex);
I have tested your code. It seems that this issue is not about your code. The following is my tested result with your code:
Entity:
public class People { [JsonProperty(PropertyName ="name")] public string Name { get; set; } [JsonProperty(PropertyName = "address")] public string Address { get; set; } }
Json File:
{ "name": "jambor", "address": "us"}
As Gaurav Mantri said, I would suggest you check your storage library. The version of my Azure storage library is 7.2.1. Please also set breakpoint at the code var obj = JsonConvert.DeserializeObject(text);
. Then check the value of text. It may help you to find out the issue.