There are different ways to create a local site on your machine. The one I am going to describe now is adapted to what we have been doing , manually create statics html and css files.
-1- Create a Virtual Directory in IIS
In IIS Manager main windows, select the Default Web Site, then right click to get the popup menu. Select “Add Virtual Directory”. Give it an alias name, then select the actual physical path where your files are.
-2- Modify the Directory Security settings to allow the “Internet User” to read and execute scripts.
IIS_IUSRS is the name given by the system to your Internet Guest. You need to give him rights as seen on the picture, in order to allow him to access your site content.
-3- Rename your file to match a default file name. Otherwise we would have to lower server security to allow to browse the directory.
The file used in previous steps was named something like ““HTMLPartOneStepTwo.html”. This named is not known from IIS, and as I did not want to type this exact name as part of the URL, IIS do not allow us to browse the directory, even if IIS_USERS is allowed to. Standard ISS configuration disallow this feature. As you may seen on the screen shot, ISS kindly explain to us what we need to do to allow this feature, but it’s not a very good idea for quite obvious security reasons. In our (very simple) case, to see our page “served” by the server, we simply rename it “Index.html”.
-4- Point your browser to the local Url
After this filename change, I just had to refresh the page to see it apprear, exactly identical as she was at the end of the previous step. The only difference being that, this time we get it through the Internet Server rather than through the file system. As this is totally static HTML, there is no other difference.
First Part Conclusion
As we have now seen what happens on the Browser side, we are finally ready to start working server side, that is beging with MVC and code.
If you have not yet done so, I invite you to subscribe to our email updates, so that you will be informed as soon as a new post is made.
MVC 4 Web Application Tutorial – Create a Local IIS Site – First part – Step 3
Posted in ASP.NET MVC 4.0