2

I have a solution that includes a mix of .NET 3.5 and 4.0 projects. The 3.5 projects cannot be upgraded due to external dependencies.

The solution uses a simple plugin mechanism and I've set the output path on all projects to a common bin folder in the solution folder so that plugin assemblies can be discovered and loaded when debugging.

I have .NET 3.5 projects referencing a 3rd party assembly and .NET 4.0 projects referencing the 4.0 version of the same assembly, which has the same file name as the 3.5 version. When I build, one version of the 3rd party assembly overwrites the other version.

I'd like to have these dependencies output to different subfolders so I can then set the probing private path in config but I can't see how to do this in the build process.

Matt Siebert
  • 367
  • 1
  • 9

1 Answers1

2

In all projects which overwrites referenced assembly, use CopyLocal: None property option for that reference in all projects using that assembly being referenced to, and using build events, copy that assembly to the output folder from it's original path in your primary build solution, to the places you required for the plugins. That will copy the required dll for the plugins only once after the primary builds up.

Alan Turing
  • 2,482
  • 17
  • 20
  • Thanks, I was thinking about this but thought there might be a better way. I'll use this solution, but with a twist - my post-build events will move files around from the output folder to a subfolder instead of going back to the assembly's original location. This way, the assembly's original location is only stored on the – Matt Siebert Sep 16 '11 at 00:42
  • Create a new configuration for the solution; for each project set output build directory in project properties in a build section to ..\bin\public or alike, depending of relevant depth location of you projects against solution folder. In post build event, use $(SoultionDirectory)\bin\public folder, pointing to the same output folder for other actions related to the assemblies. You will not be fixed to the locations. At first, put all assemblies in a $(SoultionDirectory)\bin\public location. At second, reuse assembly references for a projects from the new folder location – Alan Turing Sep 16 '11 at 03:09