In ASP.NET Core MVC these ways are possible to serve Favicon:
Place favicon in wwwroot and then serve it using
/faviconpathPlace it in a custom folder, and then use
PhysicalFileProviderto configure delivering static files with special patterns from that folder
However, the third way, which by the way is the old way, is to put Favicon in the root folder of the project, and serve it from there.
I need the third option because we're using a Software Production Line, that has its rules.
So, is it possible?
Update: Some point me to the old questions regarding ASP.NET MVC. For those people, ASP.NET Core MVC serves static contents differently and these two technologies are not the same. Anything static in ASP.NET MVC would be served as simple as pointing to it in URL. In ASP.NET Core MVC things are different.
UseStaticFileshave to do with the post you linked to?IgnoreRoutedoesn't exist in ASP.NET Core, so that doesn't apply. He's asking about the project folder, not the site folder, which is what you get withUseStaticFiles.Directory.GetCurrentDirectoryinstead of a hard-coded path like that answer suggests.wwwrootfolder, which turns out to be yet another folder. My question is very specific about the root of project, just sibling to Program.cs and Startup.cs.favicon.icoin the root folder of the project, it will be ignored by default. If you set itsCopy to Output DirectorytoCopy Always, it will be copied into the root folder of the deployed website, just outside thewwwrootfolder. You can then use theStaticFileOptionsand target that location withDirectory.GetCurrentDirectorylike @McGuire suggests.