views:

61

answers:

1

I have a VS.NET solution with two Projects, ProjectWeb and ProjectLibrary. PW depends on PL, so I have a VS.NET project reference to PL in PW.

That works all well and good on my dev box, but when it all gets to the build server, I have two different build projects, one for PL and one for PW. I'd like to build PL and copy the binaries somewhere. Then, I'd like to build PW and it only, using the binaries from the previous PL build.

But will that work since the PW VS.NET project is referencing a project that doesn't exist when I build PW only on the build server?

How can I set this up

For specifics, I am using CC.NET and NAnt, but I have other projects that use Hudson and straight MS build

+1  A: 

one approach I have used in the past is to have a postBuild event on the PL project which copies your dll to LocationX (something like this)

XCOPY $(TargetFileName) LocationX /R /Y

(the /R /Y is needed to force an ovewrite of the file which is usually required if the dll is stored in source control and is readonly...otherwise not really needed).

Then in PW do not use a project reference, reference the dll in LocationX instead. Then all will work on your machine and on the build box.

You can still include PL in your solution so debugging should still work fine.

Note that using the PostBuild event is a bit of an 'old' way of doing it, you're better off creating an AfterBuild MsBuild target which does the xcopy work. Same result though.

wallismark
Thanks for the tip, I'll try it out.
slolife
This gives me another angle to try: Like you said, don't use project references in PW. Instead, browse to the dll location and include the reference using a file location. That might work.
slolife