Build and deploy asp.net MVC WCF application - asp.net-mvc

I am fairly new to creating deployments for projects.
I have a asp.net MVC web application and WCF service layer (5 services).
Our QA team needs to get latest build packages to test the application.
At the moment we have command line build scripts which gets the latest source, build with the Visual Studio and copy those build outputs to IIS and Services folder(Services are hosted as Windows services).
What would be the recommended way to do this? We have TFS builds, but we are not using those build outputs at the moment.
What would be the recommended way to set up a deployment for these projects?

You should automate your deployment pipeline.
You can use TFS builds in conjunction with Web Deploy or with Octopus to achieve this goal.

Related

Customize TFS Auto Builds and Deploys

We use TFS 2012 as our Source Control Repository and we also use it to deploy our Web Applications (primarily ASP .NET MVC applications with Entity Framework Code First Databases) using TFS Build and Deploy from Team Explorer within Visual Studio.
Our's is a fairly small and new setup, so up until now, we developers have been deploying code to the production servers. But from an Audit point of view, it has been decided that code installation will be handed to a separate group. At the moment, before we deploy code using TFS Automated Deploy we do a couple of steps which are manual steps
- Log on the production server, backup the individual application within IIS using IIS --> Export to export it to a zip file.
- Stop application pool for the IIS application where new code is being installed
- Install new code from Visual Studio --> Queue new Build
- Get back on the server to restart the application pool and do tests to see if the application is working as expected.
I wondering, if anyone can guide me, if there is any way to change the Automated Build and Deploy template / process / workflow to do these manual steps before it does these steps before and after it deploys the code? Basically, the new team doing the code install to the Production Server and they will still click and install code automatically but the buid templace / process / workflow will do these steps as a part of the Build / Deploy process.
thanks
if you can code it, Powershell, bat etc. then you can add it to the template.
Identify where in the workflow you need to add your new steps. you can then add an invoke process activity to call out to your scripts, that will do the currently manual steps.
I would have thought most of the IIS steps can be automated using powershell and iis appcmd
Also it may well be worth looking at Release Management 2013 as your deployment pipeline, it will give a more Auditable stream and allow for sign off to approve deployments. http://www.visualstudio.com/en-us/products/release-management-for-microsoft-visual-studio-vs.aspx

TFS Build- Deployment

I am trying to do a full CI-CD cycle using TFSonline.
when I go with 'AzureWebsite' along with Visual Studio Online, it provides me with a build definition using 'tfvccontinuousdeploymentTemplate.12.xaml'.
On check-in I get the output, the build triggers and deployment also happens to the azure website. The log contains build along with my deployment details, which is also reflected on the TFS portal
When I go the conventional iis route, I tried 2 steps
With Default build template and the good old ms build arguments /p:DeployOnBuild=true /p:VisualStudioVersion=12.0 /p:PublishProfile="dasd.pubxml" this does the build and deploy but I don't get the 'deployment summary', which is to be expected, because i did it via ms deploy...
I used the tfvccontinuousdeploymentTemplate and provided the build settings as the publish xml... well... build happens but the deployment does not
I'd like the build to contain the deployment summary for my deployment.
TFS Online has since been replaced by Visual Studio Online and since by Visual Studio Team Services. The XAML based build engine has been marked for deprecation and will be removed from Team Services in the near future.
The hosted build controller has since been upgraded with build templates for Visual Studio 14, upgrading to the latest tfvccontinuousdeploymentTemplate.14.xaml may also sole your issue until the XAML build engine is removed.
The new Build Engine ships with a "Deploy to IIS" task and there is a 3rd party MSDeployAllTheThings extension which makes it very easy to pick up packaged Web projects.
Your solution to switch to InRelease has since also been replaced by 2 different versions of Release Management and the latest release management feature uses the same tasks as the new build engine uses. So it's able to use the same Deploy to IIS and MSDeployAllTheThings task.
Due to the fact that this question is related to a SaaS solution, the old options are no longer available or will soon be removed.

Continous Integration with ASP.NET MVC and TFS

I have an ASP.NET MVC 3 application. This application is hosted in TFS. I have setup a build server. When a checkin happens, my code is complied and dropped in a folder on my test server. The drop folder is an IIS application folder. The goal is when a user visits http://[myTestServer]/MyProject, they should see the latest compiled version of the app. In an attempt to do this, I'm dropping files in //[myTestServer]/c$/inetpub/www/myProject/. However, I'm getting more than I bargained for.
I've noticed that the build server puts a bunch of assemblies and creates 2 directories: _PublishedWebsites and logs. _PublishedWebsites contains two directories: MyProjectName and MyProjectName_Package. From what I can tell MyProjectName contains the files that I want put in //[myTestServer]/c$/inetpub/www/myProject/. What am I doing wrong?
How do I setup it up such that when a user visits http://[myTestServer]/MyProject, they see the latest compiled version of the app?
Have a look at Microsoft's Web Deploy for deployment of Web applications and Web sites to IIS servers.
This tutorial describes in detail how to configure TFS for Web Deployment:
Configuring Team Foundation Server for Web Deployment
Creating a Team Project in TFS
Adding Content to Source Control
Configuring a TFS Build Server for Web Deployment
Creating a Build Definition That Supports Deployment
Deploying a Specific Build
Configuring Permissions for Team Build Deployment

TeamBuild and Web Deployment Projects

With the new TFS 2008 and the upcoming TFS 2010, are Web Deployment Projects depreciated? We used them in our 2005 projects because we needed the multiple distribution of files across a cluster but now that TeamBuild does that, and we are just now moving out of VSS to TFS 2008, I was wondering if there was an argument to be made on removing the WDPs and just go with a strict TeamBuild solution.
We use CruiseControl.NET to build currently but was looking at moving to one solution instead of just using the CC.NET plugin to build from TFS Source Control.
Typically speaking, in a team environment you want to use Web Application Projects anyway which lends itself to xcopy style deployments. We have dozens of applications that are under active development using this method.
When using Team Build, I highly recommend you get a copy of TFS Deployer which enables you to utilize powershell scripts that are hooked into the Build Quality settings.
Our setup is CI (leveraging TFS 2008) with TFS Deployer. A successful check in causes a build and deployment to our dev servers. When we change the build quality to "In Staging" TFS Deployer moves the projects to our staging servers. When our infrastructure team changes it to "In Production" in deploys to our web farms.
Simple, to the point

Command-line to "deploy" ASP.NET MVC project

I am using Visual Studio Team Suites to develop a ASP.NET MVC project. I can deploy the web app to my dev machine using the "deploy" item from IS. Is there a command-line tool to do this task? What I am trying to do is to setup a continuous integration server (using TeamCity Pro), so that whenever I checkin new code, I will get a new build, deploy to a remote IIS server, and then run tests on the testing server.
Thanks,
-Yi
It looks like Microsoft have such a deployment tool. Never used it myself.
Scott Hanselman has blogged about it here
MSDeploy, Microsoft's upcoming command-line deployment tool (which will be integrated into VS2010) is currently available in Beta2.
Info:
http://learn.iis.net/page.aspx/346/web-deployment-tool/
Download (x86):
http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1602
Download (x64):
http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1603
Also, if you have disk access to the servers you want to deploy to from the CI server and don't need to install/remove things from the GAC or tweak the IIS metabase, plain old robocopy is a great option.

Resources