I created vNext MVC Template then created a folder named images under wwwroot. I call like this:
<img src="~/wwwroot/images/album/1.jpg" />
But, the image is not loading. How can I reach that image?
Putting this as an answer with more details so that others will see.
The wwwroot
folder in the app is the root of the static, servable files. As such, wwwroot
does not appear in the URLs. Take a look at the project.json
file to see where that comes into play:
{
...
"webroot": "wwwroot",
...
}
This is telling ASP.NET vNext that static files (the "webroot") are located in the wwwroot
sub-directory. This is the default location where the Static File middleware will return files from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With