title: How to debug image not found error in a blazor project?
body: <p>In my small blazor project I want to display an image in a view as follows:</p>
  <pre><code>&lt;img scr=&quot;img/background.jpg&quot; class=&quot;img&quot; alt=&quot;background&quot;&gt;
  </code></pre>
  <p>But all I see in the browser is the 'alt'-text (sorry for the dark image, it's a dark themed website):</p>
  <p><a href="https://i.stack.imgur.com/s6HzP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s6HzP.png" alt="enter image description here" /></a></p>
  <p>The image is located in wwwroot/img/background.jpg. Curiously enough in the same location is the icon of the webpage, which I call within the <code>head</code> portion of <code>_Host.cshtml</code> as follows</p>
  <pre><code>&lt;link rel=&quot;icon&quot; type=&quot;image/x-icon&quot; href=&quot;/image/icon.png&quot;&gt;
  </code></pre>
  <p>and that is showing fine.</p>
  <p>Following other similar posts like <a href="https://stackoverflow.com/questions/52135957/how-to-show-image-in-blazor-view">this one</a>, I have already tried to change the source path to any of the following:</p>
  <ul>
  <li><code>scr=&quot;/img/background.jpg&quot;</code></li>
  <li><code>scr=&quot;~/img/background.jpg&quot;</code></li>
  <li><code>scr=&quot;img/background.jpg&quot;</code></li>
  <li><code>scr=&quot;~img/background.jpg&quot;</code></li>
  </ul>
  <p>None of which seem to work. So there are two questions: 1. What could be the issue to my problem and 2. How do I debug such &quot;wrong path&quot; type of errors. For the second part, my intuition would be to use the &quot;view source&quot; option in the browser and look for the image, but so far I have not found the location of the image as the server presents it to the browser. I have also tried to use a different browser, but with the same result.</p>
  <p><strong>Edit:</strong>
  Navigating to the image with <code>https://localhost:7001/img/background.jpg</code> directly works as well. It just doesn't want to show from within the html for some reason...</p>