It looks like web deploy is just a different way of calling msdeploy? Ive read some documentation but still understand the difference between the two.
Its still referred to as the "Web Deploy tool" but I don't understand what distinguishes it from msdeploy.exe
Microsoft Web Deploy is the official name, while msdeploy is the name of the executable.
You can download and install Web Deploy from a place such as Microsoft Downloads,
https://www.iis.net/downloads/microsoft/web-deploy
And then you can use msdeploy command, as it is installed to
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
So in a simple way, the two are the same thing.
Related
Background: I am doing a POC for CI using Jenkins and MSBuild. I have installed Jenkins, MSBuild plugin and other required components on my machine and configured as well. But I don't have IIS configured on my development machine.
I want build the ASP.NET website and output the published code in a folder "c:\precompiledweb" using MSBuild script. I have
Can someone help me with MSBUild Script.
Make sure you read the prerequisites for functionality.
https://msdn.microsoft.com/en-us/library/1y1404zt.aspx
Walkthrough: Deploying a Web Site Project by Using the Publish Web Site Tool
Prerequisites
In order to complete this walkthrough, you will need the following:
Visual Studio.
*This walkthrough assumes that you selected the Web Development collection of settings when you started Visual Studio the first time. For more information, see How to: Select Web Development Environment Settings.
Access to Microsoft Internet Information Services (IIS) so that you can test the result of publishing a Web site project. In this walkthrough, it is assumed that you have IIS running on your own computer. Alternatively, you can use any instance of IIS for which you have permission to create a virtual directory.*
You need access to some IIS server.
On the flip side....you need to keep this general rule in mind. Jenkins is simply a fancy wrapper for command line calls.
So test the below (article) on your machine without IIS. If you can get the command line to work (outside of jenkins), most likely you can get it working (inside jenkins)
http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/command-line-deployment
Configure Source Code Management section, i.e. for TFS:
Add build step "Execute Windows batch command"
Insert msbuild invocation to your solution, i.e.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
"%WORKSPACE%\{solution_name}.sln"
You can add some optional parameters.
After build you can add another script invocation (batch, powershell, whatever) for copy project output to specific folder, but I would prefer another way: publish to IIS and run application immediately.
in Visual Studio create publish profile with WebDeploy target (help)
enable Web Deploy in IIS on test machine (help - when componentes are already installed go to "USING THE IIS MANAGER TO CONFIGURE WEB DEPLOY FOR A NON-ADMINISTRATOR" section)
add publish parameters to jenkins job from step 2, i.e.:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
"%WORKSPACE%\ {solution_name}.sln"
/P:DeployOnBuild=true
/p:PublishProfile="{publish_profile_filename}.pubxml"
/p:Configuration=Release
/p:Platform="Any CPU"
/p:Password={Password_for_publish_profile_same_as_used_in_VS}
And now you have jenkins click-once job for build and publish solution to test server. Add Source Code change trigger and you have basic CI.
I have created a CI with bamboo for a MVC Project. Build works fine but the problem is with the deployment using msdeploy. Below is the configuration of the deployment in Bamboo
Problem is with the arguments send to msdeploy which looks like this:
-source:package='${bamboo.build.working.directory}\Artifacts\WebDeploy\webdeploy.zip' -dest:auto,computerName="https://my_web_app.cloudapp.net:8172/msdeploy.axd?site=web_app_name",userName="deploy_user_name",password="passowrd",authtype="Basic",includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted -enableRule:DoNotDeleteRule -setParam:name="IIS Web Application Name",value="web_app_name"
When this code is run in bamboo, i am getting the following error:
Error: Unrecognized argument '"-setParam:name="IIS'. All arguments must begin with "-".
if -setParam:name="IIS Web Application Name",value="web_app_name" is removed from the script deployent is done with success but in a wrong website (virtual directory under Default Web Site)
Any ideas on how this can be fixed without using a separate .bat file?
Thanks
I dealt with a similar issue about a month ago. From everything I've seen, MSDeploy struggles to deal with arguments that have spaces in them. As a result, "IIS Web Application Name" will give you trouble. To overcome this, I excluded this argument and was able to achieve the same goal by including /p:Configuration=DeployIISAppPath="Default Web Site/web_app_name" in the MSBuild command line used to build the deployment package.
We are currently using Team Foundation Server Build Definitions to build our solution and now I want to add deployment to that. We are using TFS Build servers out of the box for our builds. Currently, we are deploying the web app to our dev integration servers using Web Deploy (MSDeploy) from within VS2010 (Publish on the toolbar). The desire is to move this publish to the build server.
What is the best approach to be able to reuse the MSDeploy mechanism (since it's already in place on IIS) and have the build server take over that task? Can I use MSBuild params or do I need an MSBuild project file? How would I configure the appropriate approach in the Build Definition? It is unclear how to configure a Publish using a Build Definition and MSDeploy.
P.S. I've seen several mentions of MSBuild using MSDeploy with cmd line params, but not in the context of using a Team Explorer Build Definition.
Some links to pages that I've seen, but are incomplete based on my needs:
Creating a Build Definition That Supports Deployment
How to Publish Web with msbuild?
The ALM Rangers' Building Guidance has all the information you are looking for, in particular the chapter "Deployment of Applications and Data Stores".
I already came up with a command that deploys the site to the target server and it works great. In case it is important in this context, here it is:
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-source:package='HelloWorld.Mvc3UI\obj\Debug\Package\HelloWorld.Mvc3UI.zip'
-dest:auto,ComputerName='https://10.225.0.30:8172/MsDeploy.axd?site=HelloWorld',username='<MyUserName>',password='<MyPassword>',authType='basic',includeAcls='false'
-allowUntrusted
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:"HelloWorld.Mvc3UI\obj\Debug\Package\HelloWorld.Mvc3UI.SetParameters.xml"
-setParam:name='IIS Web Application Name',value='HelloWorld'
-setParam:name='HelloWorld-Web.config Connection String',value='SERVER=10.225.0.25;DATABASE=HelloWorld;UID=sa;PWD=<MyPassword>;'
Now that the site is on the server, I want to be able to retrieve the \bin\HelloWorld.Database.dll file and copy it to a local directory using msdeploy.exe.
I am guessing that I have to use the package provider on the remote server (since it is what was used to deploy the site) and use the dirPath or filePath provider on the local machine. However, I am having trouble working out the exact syntax to make it work.
Background
I need the HelloWorld.Database.dll file that is already in production so it can be used to downgrade the database in an application rollback scenario. This file uses the Fluent Migrator Framework to migrate the database changes.
I discovered a solution.
"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-source:filePath='C:\inetpub\sites\HelloWorld\bin\HelloWorld.Database.dll',ComputerName='https://10.225.0.30:8172/MsDeploy.axd?site=HelloWorld',username='<MyUserName>',password='<MyPassword>',authType='basic',includeAcls='false'
-dest:filePath='F:\HelloWorldProject\HelloWorld.Database.dll'
-allowUntrusted
-verb:sync
However I would much prefer if there were a way to do this without having to specify the entire remote path because it might vary from one environment to the next. I tried and apparently it isn't supported.
What are the types of deployment we have in asp.net?
Till now what I am doing?
I use to publish my website in any folder than copy paste the compiled file to the inetpub folder [where my website is configured with the IIS]. I am not sure what kind of deployment this is, is it XCOPY? But I am not using any command line tool.
So you have the following options
xcopy deployment
Compile your asp.net application and copy all the files to your server. You can do this by using FTP or shared directories. (Or anything else to transfer files.)
WebDeploy
You have the possibility to deploy your asp.net webpage directly form your Visual Studio. If you go to "Build" and you choose "Publish Web". To be able to to do this you have to configure your server before. But this works automatically after you have set up everything. It's very handy since your deployment becomes easy to rebuild.
http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx
Web Setup - Installer
Visual Studio provide also the option to build an installer. This works like installing usual software on your windows computer with the installer wizard. (See the link)
http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx
Manage multiple server
There is also a way of managing the deployment of multiple servers. It seems to be a bit more complicated but could be interesting for professionals. (Check out on Google Microsoft Web Farm Framework 2.0
To answer your question: yes, what you are using is called xcopy deployment. Even though you do not type xcopy . ... it is still a 'plain copy' and therefore called xcopy deployment.