views:

782

answers:

5

I have 3 .net projects.

Project1.dll is generated by a VS2008 project.

Project2.dll is generated by a VS2005 project that references Project1.dll.

Project3.dll is generated by a VS2008 project that references both Project1.dll and Project2.dll.

Right now, I build Project1.dll, and manually copy it to the place where Project 2 can pick it up.

Then I build Project2.dll and manually copy it and Project1.dll to the place where Project 3 can pick them up.

Obviously I'm doing something wrong (manual). What is the correct way to keep my projects' references up to date?


Updating Project2 to VS2008 and then creating one solution containing all 3 projects is not an option at this time. We have a 3rd party visualstudio plugin that does not yet work in VS2008. Project2 must stay in VS2005

De-updating Project1 and Project3 to VS2005 and then creating one solution is not an option either. We're relying on C# 3.0 and .net 3.5 features in those projects.

+1  A: 

Hey David,

We use a build script that handles the dependencies, builds the DLLs and does what you're doing manually.

itsmatt
Granted, there are probably more elegant ways of doing this. I'm interesting in hearing about them too!
itsmatt
+3  A: 

David, Probably the best option would be to have a common build folder for all three projects. This can be done in the Project Properties-> Build -> Output path. Then point the references to the output folder. That way anytime you build any of the lower projects, the higher projects would have the latest versions. You can set the path per configurations (Debug, Release) as well, so you won't need to change that for each type of build.

Erick
This is what works for my scenario.
David B
+2  A: 

How about a pre-build event for Project3, that goes out and uses a batch file to build Project1 copy it to Project2 folder and then build project2 and copy it to project3 folder.

Sijin
I did wind up using a post-build event to handle a nuance in my case. Thanks for the tip.
David B
A: 

A trick I have used in the past is to move everything to 2008. Then I setup a special solution in 2005 for project two and use it to work with the addin. Getting this to work just depends on how bad project two behaves in 2008.

Aaron Fischer
+1  A: 

I would recommend sharing the csproj/vbproj files between the solutions. The format of the project files is compatible between the two versions of studio (solution files are not, however), and as long as your VS2008 projects are targeting the 2.0 runtime you should have no trouble compiling them. This will allow you to reference the projects, which will take care of dependencies.

The only place where this gets hairy is if you have a web project that needs to work between the two versions of studio. In that case there are some modifications to the project files which will point to the correct MSBuild target files.

ckramer
This would work for the question as written. My scenario is slightly different. There's a strict need to keep Project2 out of 2008... just my wierd life.
David B