title: Is it possible to use NewtonSoft.Json inside a T4 template?
body: <p>I want to deserialize some JSON inside a T4 template. I've referenced the assembly and all that and it all looks good but when I call this:</p>
  
  <pre><code>var root = JsonConvert.DeserializeObject&lt;RootObject&gt;(response);
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>Error   4   Running transformation: System.TypeLoadException: Could not find Windows Runtime type 'Windows.Data.Json.IJsonValue'. ---&gt; System.PlatformNotSupportedException: Operation is not supported on this platform.
     --- End of inner exception stack trace ---
     at Newtonsoft.Json.Converters.JsonValueConverter.CanConvert(Type objectType)
     at Newtonsoft.Json.JsonSerializer.GetMatchingConverter(IList`1 converters, Type objectType)
     at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(JsonContract contract)
     at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)
     at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
     at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
     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 Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
     at Microsoft.VisualStudio.TextTemplating051377DF83FAD6CEB531E8C53BDF7AF0925D52AE4E0D72D32E8A27AD05041FA9D55204F2BCFCC44A6977B1EA4AD1DA5E9682BFE9EB924836019C6E14E1AED232.GeneratedTextTransformation.GetInfoForCountries() in c:\************\CalabashTestGeneration\Template1.tt:line 117
     at Microsoft.VisualStudio.TextTemplating051377DF83FAD6CEB531E8C53BDF7AF0925D52AE4E0D72D32E8A27AD05041FA9D55204F2BCFCC44A6977B1EA4AD1DA5E9682BFE9EB924836019C6E14E1AED232.GeneratedTextTransformation.TransformText() in c:\****************\CalabashTestGeneration\Template1.tt:line 24  c:\*************\CalabashTestGeneration\Template1.tt    117 1   CalabashTestGeneration
  </code></pre>
  
  <p>Is this even possible? I don't see why a T4 couldn't use newtonsoft but this kind of hints that it can't! </p>