I am not making some sort of a connection between a string passed to DeserializeObject and when I copy the value of the same string and parse in in JsonLint.
In other words I serialize an object (a configuration object) and then take the produced file and add it as a resource to the wpf application.
Someone selects one of the templated configurations and I obviously want to deserialize the object and that is when I run into trouble.
There is something different in the way the string object is passed in code because when I take the string value and paste it into JsonLint it parses saying it is valid?
byte[] contents = global::[MyProj].Properties.Resources.config1;
string result = System.Text.Encoding.UTF8.GetString(contents);
var deserialized = JsonConvert.DeserializeObject<rtfMasterContext>(result);
Amy asked for the first 8 bytes to see if it was UTF8 Encoded. Now this will reveal my lack of knowledge but it wouldn't be encoded until Text.Encoding line finishes? On the other hand the resource is a json file that already is...utf8 encoded??
According to wikipedia a UTF8 is 239 187 191 in decimal form.
I'm gonna look into that and I'll report back.
So based upon the article and information from the comments if my file is of type json then WPF reads it in as a byte[] and prepends a UTF8 BOM.
Converting it to a string is not a problem but then deserializing the BOM throws off the json parser.
So I changed my config file type to txt and now it works as the resource is read in as a string...but I would like to have an answer to my OP.
What is the proper way to read a json resource file so I can rehydrate it?
TIA