IIS: Publish Project to remote IIS with Web Deploy.

To Push a build is too much hectic task. Like you need to publish to local machine and then copy to the remote IIS. Then can be eased by directly push the build to the remote IIS through web deploy. For this there is 2 things you need configure on in the remote IIS and other on your project file.

Configuration on Remote IIS

  1. To make this whole thing work you need to install Microsoft Web Deploy and you need to choose all the feature to be install on the machine.
  2. you need to add the feature of IIS Management Service. for this you need to make sure you have added Management tool feature to the IIS.



Configuration on the Project side
  • In the Visual Studio right click on the solution and make a rebuild.
  • Then right click on the web project and select the menu "Publish".

  • On the Profile tab Drop down list select New Custom Profile.


  • Give a name to the publish Profile and click OK.
  • Then click next and on the next tab "Connection" select Publish Method Web Deploy.
  • Then you need to fill the detail that needed
    • Server : <servername/IP where the site is hosted>
    • Sitename: <sitename that was given in iis>
    • Username:<username to login to the machine>
    • Password: <password for the above used user>There is option to save the password if you not save the password it will ask the password every time you try to publish.
    • Destination URL: <url by which user access the site>

  • You can validate the connection.if connection is valid then click next.
  • In the next tab "Settings" you need to select the configuration you want for your project to be published. like debug or release.

  • then click next and after that you will be able to publish the site by clicking the publish button. 

  • it will ask dialog about accepting you need to click accept and move ahead.
Also you can do your own web.config transformation here to keep the setting for that server on web.config when it was published. For this you need to open the properties node on your project and open the publishprofiles folder and right click on you publish profile which you have just made and do Add config transform. then it will add new tranformation file under your web.config. Do you changes that needed on the transformation and based on that project web.config file will be transformed.

Comments

Popular posts from this blog

LINQ: Using int.TryParse() within a LINQ where clause

ASP.Net MVC: Configuring asp.net session state in SQL Server.