我无法构建引用其他解决方案中其他项目的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 checkout发送到同一目录,但由于每个解决方案都在自己的构建配置中,因此团队城市会抛出有关共享同一文件夹的两个不同配置的错误。 Team City(8.1)是否有办法建立主项目?
答案 0 :(得分:0)
所以根据jetbrains论坛帖子的回答:http://devnet.jetbrains.com/message/5524301
通过转到构建配置,将checkout目录设置为自定义路径,我能够按照自己的意愿工作
运行构建并运行。