mvc: does the favicon.ico also look for a controller?

前端 未结 5 1953
灰色年华
灰色年华 2020-12-05 09:34

I get an error:

\"The controller for path \'/favicon.ico\' was not found or does not implement IController\"

Then I thought: how

5条回答
  •  执念已碎
    2020-12-05 09:44

    You can also specify the ignore route with constraints

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

提交回复
热议问题