Here I will explain how to publish or deploy the website in local machine. To publish website first we need to check whether IIS installed in our local machine or not and whether that IIS working properly or not because sometimes IIS will not work properly even that IIS already installed in our local machine for that reason we need to check all these conditions before going to publish or deploy our website in local machine.
After that now open the application in visual studio whatever the application we need publish.
1. Open the website in that top we have options Build click on that you will find Publish website click on that it will open one wizard in that it will ask target location i.e., the place to save the published application (ex: Create one folder on desktop or any location give that path by using browse button beside of that textbox).
2. Click on publish it publish all the files into target folder i.e., target location.
3. Now go to the folder whatever we have given in target location copy that folder and place it in wwwroot folder(path of that folder is C:\Inetpub\wwwroot)
4. Now open the Run in StartMenu and type inetmgr and Click Enter it will automatically redirect to IIS
5. Open the local computer in that open the websites after that open the Default website in that you will find our website because you have already placed our published website in to wwwroot folder. wwwroot folder is the default path for IIS if we place any websites into wwwroot folder it will automatically displays under Default Website
6. Click on the your website right side it will display all of your published pages select whatever the page first you need to run right click on that and click browse it will display your published website.
7. At that time if you get any error please right click on website in Default Website goes to Properties and click on Create button and click Ok button. Now browse your default page.
This is the one way to publish the website
Another way is
1. Type inetmgr in run command it will open IIS
2. Click on local computer in that open the websites after that open the Default website and right click on Default website in that click New option in that select Virtual Directory click on that one wizard will open click on NEXT after that it will ask Alias name give some name to display in Default website click Next now it will ask path for website give the path of your website whatever the application you to want publish or deploy after that click Next in that select Read, Run Scripts click next click finish button.
3. Now your website has been published open that website in Default website select the Default page right click on that select browse option now your website will display.
4. At that time if you get any error please right click on website in Default Website goes to Properties and click on Create button and click Ok button. Now browse your default page.