ASP.NET pages display 404 error even though they exist

Especially after a new installation of IIS role in a server, you may notice that your browser returns “404 Page Not Found” error if you try to visit ASP.NET pages. Files exist and the URL is correct. What to do in this situation?