views:

41

answers:

2

I am following the CSLA.NET for Silverlight pattern of using the same filename for the business objects assemblies. For example:

CSLA.dll               // .NET assembly
MyProject.Entities.dll // .NET assembly
CSLA.dll               // Silverlight assembly
MyProject.Entities.dll // Silverlight assembly

This is done so you can use a single code file in the .NET project, "file link" it to the Silverlight project and have both assemblies use the same code (compiling out the .NET and Silverlight functionally as needed).

The reason for the same Assembly file names is so that WCF serialization bindings just automatically work.

The issue I am having is that my build server seems to be putting both assemblies in the same output directory (the Binaries folder on the build server) and using that directory for resolving project references, but it is getting the wrong file (the Silverlight one instead of the .NET one).

Does anyone know how to deal with this situation?

EDIT:

I am running TFS 2010 Beta2, VS 2010 RC1, Build Agent 2010 RC1

A: 

A strategy I have used in the past is to use the same source directory for both projects and nesting the platform specific files in discretely named subdirectories and the same for the output e.g. bin\debug\clr and bin\debug\sl. It requires a bit of manual editing of the project files but seemed to work well. I don't remember having any trouble with the build server. but I could be mistaken.

Sky Sanders
What TFS/VS version are you running?
JasonRShaver
it was 08. was about a year ago. have no way to test now.
Sky Sanders
A: 

Aaron Hallberg mentioned to me that you can change the MSBuild activity in the workflow to not set an OutDir. This worked, but caused the Binaries folder to not get a copy of the output.

Instead, what I did was make three Build Configurations in the solution, ClrOnly, SilverlightOnly, and WebsiteOnly. Then in the Process tab of the build definition, I set the Items to Build to build "1 project(s) and 3 configuration(s)". Now the Binaries output looks like this:

Nightly_20100217.1\
                  \Multi Platform\
                                 \ClrOnly
                                 \SilverlightOnly
                                 \WebsiteOnly\
                                             \_Published Sites

And my unit tests and everything are working great.

EDIT:

The Published website on the other hand is invalid because it picks up the wrong references when it builds and publishes.

JasonRShaver