Take the 2-minute tour ×

I have an ASP.NET web site (not web project). It somehow stores references to the other projects in the solution. At build time it needs to copy them over.

I'm trying to reproduce this in an MSBuild script. I know normal references are handled by refresh files and that's good and working.

How can I get the DLL files for the project references (and their dependencies)?

share|improve this question
If you're going to downvote at least comment why... –  Daniel Little Jun 4 '11 at 7:45
add comment

2 Answers

For website projects, the easiest way is to add a Web Deployment project to your solution. This is a special project type (available from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0AA30AE8-C73B-4BDD-BB1B-FE697256C459) that mimics the "Publish" action in Visual Studio.

Once you've added it to your solution, you can then call MSBUILD.EXE to compile your web site and all of its dependencies:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\MSBUILD C:\MyWebSite\MyWebSiteDeployProj\MyWebSiteDeployProj.wdproj /target:Clean;Rebuild
share|improve this answer
That could be useful, but my script does more than publish and is already complete, I'm looking for an ajustment and am also trying to figure out how it's done in visual studio. –  Daniel Little Jun 2 '11 at 0:28
That may be more complicated to replicate than it seems at first glance, since Visual Studio will be calculating dependency orders of projects and copying assemblies into your website as needed. It gets even more fun when you start talking about projects that reference other projects. –  Daniel Nolan Jun 2 '11 at 1:44
add comment
up vote 0 down vote accepted

I haven't been able to answer this question, so I'll present an alternative

Having a main project that has all the dependencies, and the website only having a reference to one project. This seems to work well as I can just copy the contents of the main project bin directory. It also forces a design type which can be either good or bad, however it's worked well so far.

share|improve this answer
add comment

Your Answer


