1

Our current deployment steps can be briefly described as follows:

  1. Load the project in Visual Studio 2012, and change mode from Debug to Release
  2. Right-click the web application project, and select Publish
  3. Choose the "File System" publish method and create a target location
  4. Publish files onto the specified file location
  5. Zip all published files and send the package to a remote server via an FTP client, e.g. FileZilla
  6. RDC the server and manually unzip the package
  7. Add App_offline.htm to the root folder of target web application
  8. Copy only selected folders/files (not all) from unzipped package over to the target web application directory (backup the target files first)
  9. Removed app_offline.htm from root folder
  10. Restart/refresh website in IIS

It is such a pain in the butt doing it manually. And this is somehow the deployment process that my team asks me to stick with, LOL. I am by no means going to do it manually forever. There has got to be a better way.

I have so far just set up TeamCity for automating the builds. So whenever a developer checks in his/her code in TFS, a build will be triggered automatically and a notification email will be sent to team about the build status.

But automated deployment is still up in the air. So any suggestions/ideas on how to automate this process and make life a bit easier? What's the right way of deploying ASP.NET web applications?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
woodykiddy
  • 6,074
  • 16
  • 59
  • 100

2 Answers2

1

When talking about automating your ASP.NET deployment process, there are multiple avenues to consider.

First, as someone already suggested in a comment to your question, you could use Team Foundation Server to build your project and deploy.

Second, there are many tools out there doing just this. Here are a couple our team is currently considering:

Of course, there are many others.

However, if you don't want to invest any money (although development time can be money as well), you could write a suite of scripts (Python is good at this) to build your project using some console commands and copy the files to your server.

Of course, this last one is an ugly solution, but it is doable, and in certain conditions might be useful (example: long term school project).

As I see you have quite a clear image of the steps your automation process needs, perhaps you really should have a shot at implementing it yourself, if time permits.

Some pointers for different steps:

Also, please consider that when talking about automation, there are so many achievable levels of it that it almost seems like an analogue scale.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
nestedloop
  • 2,596
  • 23
  • 34
  • 1
    Since you mentioned BuildMaster, you can follow [this tutorial](http://inedo.com/support/tutorials/getting-a-simple-application-into-buildmaster) which sets up a deployment for an ASP.NET website. For a web application, simply add a "Build ASP.NET Web Project" step to the plan instead of copying the files directly. – John Rasch Jan 15 '14 at 18:42
  • Very nice suggestions. Also I will be looking at scripting stuff for automation. – woodykiddy Jan 16 '14 at 05:09
  • @JohnRasch +1 for comment from BuildMaster developer :) – nestedloop Jan 16 '14 at 08:20
  • @JohnRasch I hope this is not inconvenient, I would like to hear some reasons for choosing BuildMaster over other products (especially OctopusDeploy), as there is an actual debate in my team on this. – nestedloop Jan 16 '14 at 08:24
  • 1
    While an answer to that could fill an entire article, it really depends on what you're trying to automate. It's hard to find anything to compare BuildMaster to because it does a lot of things. But if I had to pick 4 differences to fit in here, I would say that: 1) you can deploy more than just .NET web apps and services, 2) you can add approvals and other process automation to block promotions for whatever reason, 3) it's highly extensible and all our extensions are [on GitHub](https://github.com/Inedo), 4) email notifications - completed build/deployment, approval required/given, server down – John Rasch Jan 16 '14 at 16:40
  • @JohnRasch Thanks for your response. One last question: does BuildMaster have any APIs or any other means to allow for customizing a process? (say I want to run a script before a deployment). Thanks. – nestedloop Jan 16 '14 at 16:42
  • Sure, you could simply run the script as the first action in your plan. If you want it to run for all your applications you can share that portion of the deployment plan in other applications. – John Rasch Jan 16 '14 at 18:22
  • @JohnRasch Thank you very much for your time and answers, I will be sure to pass this info to my team. Have an awesome day! – nestedloop Jan 16 '14 at 20:54
  • The MWA NuGet package is not from Microsoft, and should not be mentioned in this answer. You should try to remove it so as not to mislead others. – Lex Li May 30 '15 at 04:44
  • @LexLi Nowhere in my answer have I asserted that MWA is made or supported by Microsoft. How could any misleading occur under these circumstances? – nestedloop Jun 16 '15 at 19:24
  • @nestedloop That's exactly the problem. You should lead people to a proper solution that's supported by the vendor. I left the comment because the answer obviously goes against Microsoft's design. If you remove the words regarding the NuGet package, then this answer is not misleading. – Lex Li Jun 17 '15 at 01:00
1

Here's a guide on deploying ASP.NET applications with Beanstalk that you might find useful:

Deploying .NET & ASP.NET Applications

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ilya Sabanin
  • 786
  • 5
  • 9
  • 3
    Link-only answers aren't considered good answers. What if the link breaks. Please summarize the content of the link here. Also, please explicitly disclose your connection to Beanstalk if your answers are not to be considered as spam. – John Saunders Jan 15 '14 at 19:03