Adventures of a wannabe geek!

Ranting within

Using Add Deployable Dependencies in VS2010 SP1

Before the dawn of VS2010 SP1, when I wanted to deploy dependency dlls, I had to go to the properties of the .dll and set CopyLocal to true

image

This was critical for me when MVC3 first came out as MVC3 was not installed on our production server and we needed to deploy the MVC3 and Razor dlls to our servers in order for the application to run.

The nice people at Microsoft added a feature in VS2010 SP1 that allowed you to specify a specific set of deployable dependencies. When you right click on the web project you can now see a menu option as follows:

image

When you choose this option you get an option to choose the dependencies you want:

image

If I choose ASP.NET MVC and select ok I will now have a new folder added to my solution that has the following contents:

image

This folder is now taken care of using the new Microsoft.WebApplication.targets and Microsoft.Web.Publishing.targets file that comes with MSBuild and was upgraded after VS2010 SP1 install. MSBuild will take care of this folder and its contents and move those contents to the /bin of the application. This will work as part of a CI build or as part of using a publish with MSDeploy.

This has made my life easier as I used to have to find what files were needed as part of the deploy and keep a copy of them in a /lib folder and then use an MSBuild copy task to copy them as part of my CI build