Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I get an error:

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

Then I thought: how does the framework know for which files it has to instantiate a controller, because the same thing is true for script, css and other files?

(never thought of that, but now the favicon is complaining, I was wondering....)

But back to the error, why does that occur?

like image 527
Michel Avatar asked Jan 07 '11 09:01

Michel


People also ask

What is favicon ICO in MVC?

Whenever you open any website, you see an small icon or image on left side of the window tab, That small icon is called Favicon. If you have not noticed earlier,then just open any website and check. For an example: open www.w3schools.com and see on the left side of tab.

How does MVC know which controller to use?

Also, MVC relies heavily on reflection, which allows you to inspect types at runtime using strings. Reflection is used in many programming frameworks.


1 Answers

Add this to you global.asax:

routes.IgnoreRoute("favicon.ico"); 
like image 51
Steve Avatar answered Oct 22 '22 09:10

Steve