.NET for ANT and WAR files?

Most of our internal applications are built on the Java EE stack using Ant, and deployed to Tomcat with a WAR file. We have a build window in which a production-oriented WAR is created, and the WAR is then delivered to the test environment. A script is executed to convert the deployed webapp to indicate the test data environment.

After several Test β†’ Bug Fix β†’ Build β†’ Redeploy cycles for testing, the WAR file is then deployed to Production and then lives.

I recently inherited some ASP.NET 4.0 web applications, and their build / deployment is completely different; the code is built in VS, and then the entire project directory is copied to each environment. It is then manually configured and sometimes rebuilt using the VS instance on the server.

This is a little scary, as there are many opportunities for tweets in the same environment that need to be forgotten, and therefore we need us to play with our applications after they β€œlive”, outside of testing, version control, etc.

So, all of this is said: Is there an equivalent Ant / WAR mechanism in the .NET world? What is the safest way to create an executable artifact from a .NET webapp and move it between environments with minimal modification? I know that β€œbest grades” is a taboo phrase, but I would like to plunge into some expert knowledge before remaking Ant in .NET. :-)

+4
source share
1 answer

Three technologies you need to know to automate your online deployment:

  • MSBuild is the equivalent of Microsoft ANT. Project files are just a series of MSBuild tasks.
  • WebDeploy is essentially your WAR / Tomcat equivalent, except that it creates deployment packages and is intended for IIS.
  • XML Transforms - You'll never have to manually edit the configuration manually. Config conversions are necessary if you have several environments that you need to deploy.

Put all this together with your favorite Build server (I use Jenkins), and you can fully automate the entire deployment process in any environment. Each of these individual topics is too wide to be described in detail here, but you should be able to start with a minimum knowledge of each of them.

To give you an example of how simple it can be, here is an example of a command line assembly that will deploy a website in a 2003 / IIS6 window.

MSBUILD "MyWebSite.csproj" /p:Configuration=Dev /p:OutputPath=bin /t:Rebuild /p:DeployOnBuild=true /p:DeployTarget=MSDeployPublish /P:AllowUntrustedCertificate=True /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=http://MyDevServer /p:DeployIisAppPath="Default Web Site/MyWebSite" /p:username=deployUser /p:password=deployPassword 
+5
source

All Articles