title: Attempt by method 'System.Web.Helpers.Json..cctor()' to access method 'System.Web.Helpers.Json.CreateSerializer()' failed
body: <p>I am using <code>System.Web.Helpers.Json</code> to deserialize some JSON into <code>dynamic</code> in NET 4. The following line fails with this error: <code>TypeInitializationException: Attempt by method 'System.Web.Helpers.Json..cctor()' to access method 'System.Web.Helpers.Json.CreateSerializer()' failed.</code></p>
  
  <pre><code>var json = Json.Decode(response);
  </code></pre>
  
  <p>The <code>response</code> is lengthy but valid JSON. What could be the matter here? I have tried <a href="http://linqpad.net">LINQPad</a> with a short handcrafted JSON and it worked. Is this a configuration issue of some sort?</p>
  
  <p>[EDIT]</p>
  
  <p>Here is the actual sample JSON. It appears the content is pretty much irrelevant. When this is run in a brand new Console application or LINQPad, it works as expected. But if you try to run the same code from a brand new Windows Forms application, it barfs with the above error.</p>
  
  <pre><code>var json = Json.Decode("{\"r\":{\"0\":{\"id\":\"2\"},\"1\":{\"id\":\"33\"}}}");
  </code></pre>
  
  <p>[EDIT2]</p>
  
  <p>Actually, it turns out this has nothing to do with project types. The exception is thrown if the project is being debugged. If it is simply run, the exception does not occur. Strange, eh?</p>