title: json parsing with xamarin android
body: <p>I wrote a code to parse json string in my android xamarin app.</p>
  
  <pre><code>            var request = HttpWebRequest.Create(myUrl);
              request.ContentType = "application/json";
              request.Method = "GET";
              using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
              {            
                  if (response.StatusCode != HttpStatusCode.OK)
                  {
                      Console.Out.WriteLine("Error fetching data. Server returned status code: {0}", response.StatusCode);
                  }
                  using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                  {
                      string content = reader.ReadToEnd();
                      if (string.IsNullOrWhiteSpace(content))
                      {
                          Console.Out.WriteLine("Response contained empty body...");
                      }
                      else
                      {                        
                          List&lt;BillsTableFields&gt; billList = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;List&lt;BillsTableFields&gt;&gt;(content);                        
  //return block
                      }
                  }
              }    
  </code></pre>
  
  <p>but it throws a build error. Any help would be appreciated as I am a new to xamarin and I can't find any support anywhere else.
  The build error I got is given below</p>
  
  <p>C:\Program Files\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.</p>
  
  <p>Mono.Cecil.ResolutionException: Failed to resolve System.Diagnostics.TraceLevel</p>
  
  <p>at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)</p>
  
  <p>at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)</p>
  
  <p>at Mono.Linker.Steps.MarkStep.InitializeFields(TypeDefinition type)</p>
  
  <p>at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)</p>
  
  <p>at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)</p>
  
  <p>at Mono.Linker.Steps.MarkStep.Initialize()</p>
  
  <p>at Mono.Linker.Steps.MarkStep.Process(LinkContext context)</p>
  
  <p>at Mono.Linker.Pipeline.Process(LinkContext context)</p>
  
  <p>at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext&amp; context)</p>
  
  <p>at Xamarin.Android.Tasks.LinkAssemblies.Execute()</p>
  
  <p>at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()</p>
  
  <p>at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() (MSB4018) (LoginApptest)</p>