© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
shack

✅ aspnet core not recognizing images

I made a project in jb rider, and for some reason imgs in html are getting a 404. I had this problem with css and js scripts before, but I fixed it by including a separate get method for each of them. When I tried making one for the img, it only removed the console error. Nothing was found in Chrome Sources, and when I tried to download the image chrome had, I couldn't open it.

Startup.cs
endpoints.MapGet("/", async context =>
  {
    await context.Response.WriteAsync(await  File.ReadAllTextAsync("wwwroot/html/index.html"));
  });
endpoints.MapGet("/", async context =>
  {
    await context.Response.WriteAsync(await  File.ReadAllTextAsync("wwwroot/html/index.html"));
  });


index.html
    <img alt="img" src="/img.jpeg">
    <img alt="img" src="/img.jpeg">
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Trouble moving from MVC 5 to Aspnet Core
C#CC# / help
4y ago
ASPNET Sessions
C#CC# / help
2y ago
✅ Primary Key not recognizing
C#CC# / help
2y ago