Reputation: 2523
I would like to try the 'Web Deploy' method to deploy our website. Before my questions, I would like to provide a few details about the current deployment procedure:
It is an enterprise site & is hosted on multiple servers (with continuous deployment).
The files are not in 'Release' mode, but in 'Debug' mode.
We manually copy paste only the current assignment related files. Say, this week, the Accounts module is to be deployed, then the files to be deployed are
/mysite/App_Code/Models/accounts.cs
/mysite/pages/accounts.aspx, accounts.aspx.cs
The 3 files will be copied to the respective folders in all the servers manually. This has been the procedure for years here.
I have created the packages in the dev system,
(i) using the publish option(web deployment package) in Visual Studio and also
(ii) export application in IIS (gives the option to select the files)
I did not go for the Installing package part yet.
Upvotes: 0
Views: 2088
Reputation: 14373
1 - Not through VS because there is no extension point (that I know of) into MSBuild for Websites. Sayed has a great post which describes how Websites are treated differently than Apps.
Alternative - You could copy the files you wish to deploy to a new folder and then use the MSDeploy.exe commandline tool to create a customer MSDeploy package which you can deploy to your server.
D:\temp>"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:contentPath=%cd%\DefaultWebSite\website1 -dest:package=DefaultWebSite.zip
Info: Updating MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding virtual path (D:\temp\DefaultWebSite\website1)
Info: Adding directory (D:\temp\DefaultWebSite\website1).
Total changes: 3 (2 added, 0 deleted, 1 updated, 0 parameters changed, 0 bytes c
opied)
D:\temp>"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package=DefaultWebSite.zip -dest:contentPath="Default Web Site\website2"
Info: Adding MSDeploy.contentPath (MSDeploy.contentPath).
Info: Adding virtual path (Default Web Site\website2)
Info: Adding directory (Default Web Site\website2).
Info: Adding file (Default Web Site\website2\Default.aspx).
Info: Adding file (Default Web Site\website2\Default.aspx.cs).
Info: Adding file (Default Web Site\website2\Web.config).
Total changes: 6 (6 added, 0 deleted, 0 updated, 0 parameters changed, 971 bytes
copied)
2/3 - Yes you could include SQL into the web deployment package but it would be deploy each time the package is deployed. We have found its better to seperate our SQL deployments into its own package so we can deploy it only when we want to.
This post describes how we handle our SQL deployments - https://dotnetcatch.com/2016/02/10/deploying-a-database-project-with-msdeploy/
Upvotes: 3