title: How can I parse a JSON file from Assets folder in UWP - Closed
body: <p>I am new developing windows UWP app and I am trying to parse a JSON file from my assets folder. I've seen many tutorials, but when I tried they don't work. Please, someone help me to parse it and if you can with an example.</p>
  <p>I am using VS2017 and C#;</p>
  <p>This is the library that I want to use:</p>
  <pre><code>using Windows.Data.Json;
  </code></pre>
  <p>My code is:</p>
  <pre><code>private Uri appUri = new Uri(&quot;ms-appx:///Assets/marker.json&quot;);
  private string title;
  private void ConverJSONtoObjects()
          {
              try
              {
                  Uri appUri = new Uri(fileName);//File name should be prefixed with 'ms-appx:///Assets/* 
                  StorageFile anjFile = StorageFile.GetFileFromApplicationUriAsync(appUri).AsTask().ConfigureAwait(false).GetAwaiter().GetResult(); 
                  string jsonText = FileIO.ReadTextAsync(anjFile).AsTask().ConfigureAwait(false).GetAwaiter().GetResult(); 
                  JsonArray obj = JsonValue.Parse(jsonText).GetArray();
                  for (uint i = 0; i &lt; obj.Count; i++)
                  {
                      title = obj.GetObjectAt(i).GetNamedString(&quot;name&quot;);
                  }
                  message(&quot;Place&quot;, title);
              }
              catch (Exception ex)
              {
                  message(&quot;Error&quot;, ex.ToString());
              }
              
          }
  </code></pre>
  <p>I'm getting this error:
  <a href="https://i.stack.imgur.com/Im6PE.png" rel="nofollow noreferrer">error handled by Exception</a></p>
  <p>My file is like this:</p>
  <pre><code>[
  {
  &quot;id&quot;:1,
  &quot;name&quot;:&quot;CabaÃ±as Nuevo Amanecer&quot;,
  &quot;lat&quot;:&quot;18.402785&quot;,
  &quot;lng&quot;:&quot;-70.094953&quot;,
  &quot;type&quot;:&quot;Normal&quot;,
  &quot;phone&quot;:&quot;No Disponible&quot;,
  &quot;price&quot;:&quot;DOP 500&quot;,
  &quot;image&quot;:&quot;http://i65.tinypic.com/10mif69.jpg&quot;
  },
  {
  &quot;id&quot;:2,
  &quot;name&quot;:&quot;CabaÃ±as Costa Azul&quot;,
  &quot;lat&quot;:&quot;18.424746&quot;,
  &quot;lng&quot;:&quot; -69.990333&quot;,
  &quot;type&quot;:&quot;Lujosa&quot;,
  &quot;phone&quot;:&quot;(809) 539-6969&quot;,
  &quot;price&quot;:&quot;DOP 4453&quot;,
  &quot;image&quot;:&quot;http://i64.tinypic.com/wcd5b8.png&quot;
  }
  ]
  </code></pre>
  <p><strong>Solution (updated 2021/11/7)</strong></p>
  <p>Hi, for those how have the same problem, the issue was in the file properties: <strong>The build action needs to be Content</strong> for being able to call a file from the Assets folder in UWP</p>