views:

41

answers:

1

Hi,

We have 2 Silverlight projects in the same solution; SLGlobalResource and SLData. SLData references SLGlobalResource (using references > add reference > projects).

When we build it in debug within VS2008, everything builds fine and all is good.

But when we build it using:

msbuild TheSolution.sln /p:Configuration=Debug /t:rebuild

SLData fails with the following error:

ViewModels\ImportViewModel.cs : error CS0246: The type of name space "SLGlobalResource" could not be found (are you missing a using directive or an assembly reference?)

This also happens in TeamCity (I guess because the TeamCity vs2008 runner uses MSBuild)

Any ideas?

Thanks

Edit:

There are actually 33 projects in total in the solution. I didn't think this was relevant before but now I'm thinking it could be - could this be a build order thing?

Edit 2:

I found that building with msbuild would succeed if I use the '/t:build' parameter instead of '/t:rebuild' which pretty much confirms it's a build order thing. I've tried specifying the correct configuration (debug) and platform (x86) and also made sure the all the references are project references and still no luck. I guess I'll have to write a build script to explicitly build these in the correct order and use that unless any one has any better ideas?

Cheers

+1  A: 

In some cases MSBuild can build things in an unexpected order.

I ran into this problem and found the following KB article helpful:

http://support.microsoft.com/kb/964125/EN-US

Dana Holt