Automating WSDL.exe in a Custom Build - asp.net

I have a web application written in C# that consumes several internal web services. We have a development tier, a testing tier, and a production tier. Also, we use the WSDL.exe command to generate a Proxies.cs file for a given tier's web services.
When we are ready to deploy our code up the stack from development to test or test to production, we need to run the WSDL.exe command to point to the appropriate version of the web services.
Is there a generally accepted way to automate this?

There are a number of way to do it. A NAnt build script will do it, but I think the most commonly accepted method now is to use MSBuild. See MSDN for details.

Our company uses a combination of NANT + Cruise Control + Custom Utility apps to build our products. More specifically, the task in NANT will allow you to fire off those command-line applications such as WSDL.exe

Related

Deploy Web-Api, Asp.net project and a Windows service in one msi project

Is it possible to deploy ;
1- a web-api project
2- a website written in Asp.net
3- a WCF service as windows service
in one msi file using/in Windows Web Installer Project (preferably) or in Wix ?
Yes, it is possible using WiX. I maintain an open source project called IsWiX that even makes it somewhat easy. See:
Create and Package a Windows Service using IsWiX
IsWiX Web Site Demo
The concept behind IsWiX is project templates (scaffolding) and graphical designers that give you a project structure and most heavy lifting for your WiX MSI project. The template already contains examples of IIS configuration that merely need to be uncommented out. If you need a Web API and a Web Site you'll have to clone that part of the code and make a few adjustments. For example a static website typically won't be a web application where a web-api will be. Then you'll use the services designer to define the windows service. The fact that the service hosts a WCF endpoint really doesn't matter.
For that matter, one of the really cool things about WCF is it's possible to eliminate your dependencies on IIS. I've seen solutions using this with no dependency on IIS and this really makes creating installers a lot simpler.

How to automate NUnit tests in an ASP.NET website project?

I have a client who has a large existing application written in ASP.NET, which is setup as a website project in Visual Web Developer 2010 Express.
I have been asked to demonstrate how to write unit tests and to help configure the Hudson build environment to run these tests automatically.
The code is reasonably well structured and although it does not use any UI patterns there is good separation. Business logic tends to sit inside separate classes rather than within the .aspx or associated code-behind files.
Nevertheless, as a website project rather than a web application, DLLs are not generated so the tests we have written cannot be run by the NUnit GUI.
I would like to be able to run the tests before check-in.
I would like to run the tests automatically as part of the continuous build process.
I cannot change the project type to a web application as there are downstream processes that are dependent on the project type.
Whilst upgrading to Visual Studio Professional is being investigated, I have to assume for the purpose of this exercise that I will need to make it work on VWD.
What are my options to achieve this, given the constraints above? Is it even possible?
TIA

Testing ASP.NET site using WatiN. Is it possible to programmatically deploy an ASP.net site locally?

I would like to use WatiN to test the functionality of a website I'm developing. Ideally, I would programmatically deploy the website (asp.net MVC3) before the tests start running, and then refresh the data before each test. Is this possible?
Read here about using MSBuild to deploy web projects. Getting your application into automated deploy on build success (read: Continuous Integration) is really nice.
MSBuild - How to use MSBuild to deploy an ASP.NET MVC application
Using NUnit, for refreshing the data before each test you can decorate a method with [Setup] (or [TestFixtureSetup]) to run code once before each test (or once before each group of tests). I use this for cases that require specific data setup and it works like a champ. I'm assuming other XUnit frameworks have similar mechanisms in place.
Setup - http://www.nunit.org/index.php?p=setup&r=2.2.10

Using Web Setup Project for multiple types of projects

I am trying to a create an installer for my web application. My solution contains several projects. They include:
Class library project (referenced by the web application)
Web Application
Windows Service
Web Services project
Database project (execute update script)
I also have an unmanaged dll (crystal reports) in my web application project, so I might have to do some editing of the registry.
I ideally want to be able to use a web setup project to install the whole solution. Can this be done? Is there a better method/solution?
The short answer is "Yes" it can be done.
Other better solution? Well, I'm not a huge fan of VS.NET's installer/setup, can be kind of bulky, 3rd parties could be better at a price. Having said that, it should be able to satisfy your requirements.

What is the best way to rollout web applications?

I'm trying to create a standard way of rolling out web applications for our company. Currently we do it with zip files, vbscript/javascript, and manual some steps.
For thick client installs we generate MSI installers using Wise/Wix. We don't create installers currently for websites as in general they are just xcopy deploy. However we have some config files that need to be changed, verify that certain handlers are registered in IIS... The list goes on.
Do most people use MSI installers for web applications as well, or some other tool/scripting language?
I recently spent a few days working on automating deployments at my company.
We use a combination of CruiseControl, NAnt, MSBuild to generate a release version of the app. Then a separate script uses MSDeploy and XCopy to backup the live site and transfer the new files over.
Our solution is briefly described in an answer to this question Automate Deployment for Web Applications?
Do consider MSDeploy, that is the direction Microsoft will be investing in the future for deployment of web applications...
Know more about the future direction at Overview Post for Web Deployment in VS 2010
We have been using FinalBuilder (www.finalbuilder.com) for this purpose for long time and for some time also using InstallAce (www.Installace.com) for build deployment on the Web Farm.
You may want to look at:
How do I get a deployable output from a build script with ASP.NET
Step by Step ASP.NET Automated Build/Deploy
We use MSI to create basic installers for our web projects too, often using the Web Setup Projects in VS and sometimes completely custom installers. You may also want to look at MSDeploy.
We're moving to an MSI for our installs, so far with mixed results. I'm a control freak so I would personally prefer a series of scripts that I had more direct control over. I've used ANT in the past with good results.
Have you checked out NAnt and CruiseControl?
Combined, they can provide an easy and automated way to build and deploy your web apps.
I work for a state agency and we do all our deployments using a product called RepliWeb.
It works good because as dev's we have no control over the webservers. But we can deploy to a deployment area and run the RepliWeb job to do the deployment. Not sure on pricing though...

Resources