Why is Chrome searching for my favicon.ico when I serve up a file from ASP.NET MVC?

后端 未结 12 1434
死守一世寂寞
死守一世寂寞 2020-12-16 14:32

I have a controller in MVC serving up images from a database.

EDIT: This still happens if I serve up a file over completely standard means in MVC.

Eve

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-16 14:32

    I ran into this problem a while back and got around it by ignoring the specific route by adding

    routes.IgnoreRoute("{*favicon}", new { favicon = ".*/favicon\\.ico" });
    

    into the RegisterRoutes method in Global.asax.

提交回复
热议问题