How do I get a project with references to other projects in other solutions to build?

http://stackoverflow.com/questions/26003494/how-do-i-get-a-project-with-references-to-other-projects-in-other-solutions-to-b

I cannot build my web projects solution that references other projects in other solutions (VS2014).
The web project references the other projects as external projects instead of the built DLLs.
The solutions each have their own github repository. I've created a quick sample of the how the solutions relate to each other here:

If you open main solution, you can see that it references libsolution

Solution
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibSolution", "..\LibSolution\LibSolution\LibSolution.csproj", "{08528F48-434D-4DF5-95B9-35178E73399B}"
EndProject

Project
<ProjectReference Include="..\..\LibSolution\LibSolution\LibSolution.csproj">

The build log is like so (error highlighted at the bottom)

[14:21:41]Checking for changes
[14:21:41]Will perform clean checkout
[14:21:41]Clean checkout reasons
[14:21:41]Publishing internal artifacts
[14:21:41]Clearing temporary directory: C:\AmsCI\TeamCity\buildAgent\temp\buildTmp
[14:21:41]Checkout directory: C:\AmsCI\TeamCity\buildAgent\work\792fe8e34d5b0582
[14:21:41]Updating sources: server side checkout (1s)
[14:21:43]Step 1/1: Visual Studio (sln) (4s)
[14:21:43][Step 1/1] Starting: C:\AmsCI\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\AmsCI\TeamCity\buildAgent\work\792fe8e34d5b0582 "/msbuildPath:C:\Program Files (x86)\MSBuild\12.0\bin\MSBuild.exe"
[14:21:43][Step 1/1] in directory: C:\AmsCI\TeamCity\buildAgent\work\792fe8e34d5b0582
[14:21:45][Step 1/1] MainSolution.sln.teamcity: Build target: TeamCity_Generated_Build (1s)
[14:21:45][MainSolution.sln.teamcity] TeamCity_Generated_Build (1s)
[14:21:45][TeamCity_Generated_Build] MSBuild (1s)
[14:21:45][MSBuild] MainSolution.sln: Build target: Rebuild (1s)
[14:21:45][MainSolution.sln] ValidateSolutionConfiguration
[14:21:45][MainSolution.sln] Rebuild (1s)
[14:21:45][Rebuild] MSBuild (1s)
[14:21:45][MSBuild] C:\AmsCI\TeamCity\buildAgent\work\792fe8e34d5b0582\MainSolution.sln.metaproj error MSB3202: The project file "C:\AmsCI\TeamCity\buildAgent\work\792fe8e34d5b0582\..\LibSolution\LibSolution\LibSolution.csproj" was not found.
[14:21:45][MSBuild] MainSolution\MainSolution.csproj: Build target: Rebuild (1s)
[14:21:45][MainSolution\MainSolution.csproj] CoreClean
[14:21:45][MainSolution\MainSolution.csproj] GetReferenceAssemblyPaths
[14:21:45][MainSolution\MainSolution.csproj] PrepareForBuild
[14:21:45][MainSolution\MainSolution.csproj] ResolveProjectReferences
[14:21:45][MainSolution\MainSolution.csproj] ResolveAssemblyReferences
[14:21:46][MainSolution\MainSolution.csproj] CoreCompile
[14:21:46][CoreCompile] Csc
[14:21:46][Csc] C:\Program Files (x86)\MSBuild\12.0\bin\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll /reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\\mscorlib.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll /reference:C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\MainSolution.exe /subsystemversion:6.00 /target:exe /utf8output Program.cs Properties\AssemblyInfo.cs "C:\AmsCI\TeamCity\buildAgent\temp\buildTmp\.NETFramework,Version=v4.5.AssemblyAttributes.cs"
**[14:21:46][Csc] Program.cs(1, 7): error CS0246: The type or namespace name 'LibSolution' could not be found (are you missing a using directive or an assembly reference?)**
[14:21:47][Step 1/1] Process exited with code 1
[14:21:47][Step 1/1] MSBuild output
[14:21:47][Step 1/1] Step Visual Studio (sln) failed
[14:21:47]Publishing internal artifacts
[14:22:49]Build finished

From the looks of it, it can't find the csproj because by default, teamcity puts each solution in their own working folder for building, so the paths broke. I tried having teamcity checkout to the same directory, but since each solution is in its own build config, team city throws an error about two different configurations sharing the same folder. Is there a way for Team City(8.1) build the main project?

3 comments
Comment actions Permalink

Hi,

It is not recommended to use Custom checkout path. In this case we would recommend to configure artifact dependency and use DLLs.
If it is not the suitable you can checkout projects in one folder but in different subfolders or create one project with two VCS roots.

0
Comment actions Permalink

I'm not sure if this is what you meant, but I went to the build configuration, set the checkout directory

for refenced solution C:\TeamCity\buildAgent\work\parent\<name of referenced solution directory>
for main solution C:\TeamCity\buildAgent\work\parent\<name of main solution directory>

ran the builds and it worked.
Thanks

0
Comment actions Permalink

It's exactly what I meant as the second solution. You are welcome!

0

Please sign in to leave a comment.