1)Turn on IIS Feature
Control Panel > Programs and Features > Turn Windows features on or off.
2) Run(Window+R) > “inetmgr” to Open The IIS console
NOTE : if you could not find “inetmgr”, make sure that you have selected in “Turn Windows features on or off” in step 1.
Internet Information Services > Web Management Tools > IIS Management Console
3) Change to “.NET Framework” of “DefaultAppPool” in “Application Pools” to v4.0
The below warning is normal, and will not effects the showing of the webpage.
Debugging MVC Project
We can choose the browser to open.
This will open that browser in the random port ( i.e. http://localhost:41787/ ).
NOTE : The localhost URL ( i.e. http://localhost:41787/ ) can be access only the local machine. We could not use http://whateverIP:41787/ to access from outside.
Publish MVC Project
Right click at the Project in visual studio > Publish
choosing : “Web Deploy”
For example, below profile is publish to localhost.
or we can publish using Old-fashioned “File System” Publish method like so.
NOTE : If you have encounter white page, make sure that you have selected in “IIS > World Wide Web Services > Common HTTP Features > Static Content” in step 1.
If we face the “Handler StaticFile Error”, the solution is in the URL below.
ref : https://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis
Right click > Edit bindings …