Shouldn't MVC ignore images by default?

ε祈祈猫儿з 提交于 2019-12-01 08:48:49

That's actually handled by your hosting environment/web server, not by MVC per-se.

I suspect you are using the Visual Studio Web Server during development, right? The Visual Studio Web Server does not handle these requests by default.

If you host your project with IIS, IIS will take care of this. IIS will intercept the request to a JPG and handle it rather than letting hit your code. But the Visual Studio Web Server does not.

It's not uncommon to have the ignore route that you mentioned because a lot of people develop with the VS Web Server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!