2014-09-23 52 views
1

我無法構建引用其他解決方案中的其他項目的Web項目解決方案(VS2014)。如何使用其他解決方案中的其他項目來構建項目?

Web項目將其他項目引用爲外部項目而不是構建的DLL。

每個解決方案都有自己的github存儲庫。 我創建的一個快速的樣品解決方案是如何相互關聯的位置:

如果打開主解決方案,你可以看到它引用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"> 

構建日誌是這樣的(錯誤突出顯示在底部)


[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 

從外觀上來看,它不能因爲默認情況下找到的csproj,TeamCity的把每個解決方案在自己的工作文件夾建立,所以路徑突破。我嘗試將teamcity簽出到相同的目錄,但由於每個解決方案都在其自己的構建配置中,因此團隊城市會拋出關於共享相同文件夾的兩種不同配置的錯誤。 Team City(8.1)有沒有辦法建立主項目?

+0

您需要讓其他人蔘與設置此構建服務器。您前進的方式將會非常糟糕,您正在參考GAC中的程序集。這非常非常糟糕,並導致運行時錯誤極難診斷。構建錯誤是另一個錯誤,由於沒有暗示它嘗試構建依賴項目,因此可能會導致錯誤。向隊友尋求幫助,可以看看你的肩膀,看看你做錯了什麼。並考慮*不*使用teamcity,顯然它不是幫助你。 – 2014-09-23 21:53:40

+0

你在哪看到我在GAC中引用程序集?示例項目只有一個額外的參考,這是另一個解決方案中的另一個項目。另外,我認爲構建錯誤非常明顯,它說被引用項目的路徑是錯誤的。這是正確的,因爲最初,這兩個解決方案文件夾是兄弟姐妹,現在他們不是。 – 2014-09-24 00:57:35

回答

0

所以根據上JetBrains的論壇後回答:http://devnet.jetbrains.com/message/5524301

我能夠把事情的工作像我想的要構建配置,設置檢出目錄到自定義路徑

  • 對於refenced溶液C:\ TeamCity的\ buildAgent \工作\親\
  • 主溶液C:\ TeamCity的\ buildAgent \工作\親\

跑了構建,它的工作。

相關問題