When migrating from TFS 2008 to TFS 2010 dealt with an issue of some of the projects in the solution not building on the TFS 2010 Build Server even though the Solution builds successfully in Visual Studio.
The .sln (Solution File) can have all the all the necessary “Project Dependencies” specified in Visual Studio, but will get “CSC : error CS0006: Metadata file ProjectB.dll could not be found“. Even if your csproj files have correct references to other solution projects, msbuild will fail.
The changes needed to be made to the .SLN (Solution File) which is needed by MSBuild is in the “ProjectSection(ProjectDependencies) = postProject” section of SLN file.
Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ProjectA”, “ProjectA.csproj”, “{7F922E75-5542-4573-B0F9-4B0B3F9C9B33}”
ProjectSection(ProjectDependencies) = postProject
{0BED50D6-34F9-445F-A0E4-F41C84B54B07} = {0BED50D6-34F9-445F-A0E4-F41C84B54B07}
EndProjectSection
EndProject
Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ProjectB”, “ProjectB.csproj”, “{AECBB27F-4A03-4171-8A0A-BD7D43A856FE}”
EndProject
If the project has dependencies on multiple projects the following are the changes needed to be made to the SLN (Solution File).
Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ProjectA”, “ProjectA.csproj”, “{7F922E75-5542-4573-B0F9-4B0B3F9C9B33}”
ProjectSection(ProjectDependencies) = postProject
{0BED50D6-34F9-445F-A0E4-F41C84B54B07} = {0BED50D6-34F9-445F-A0E4-F41C84B54B07}
{64F56E9A-6E9D-41AE-99BC-9CEE98B82BA0} = {64F56E9A-6E9D-41AE-99BC-9CEE98B82BA0}
EndProjectSection
EndProject
Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ProjectB”, “ProjectB.csproj”, “{AECBB27F-4A03-4171-8A0A-BD7D43A856FE}”
EndProject
Project(“{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}”) = “ProjectC”, “ProjectC.csproj”, “{64F56E9A-6E9D-41AE-99BC-9CEE98B82BA0}”
EndProject

Posted on January 29, 2012
0