如何配置TeamCity以使用2个项目构建解决方案? [英] How to configure TeamCity to build a solution with 2 projects?
问题描述
如何配置TeamCity以使用2个项目构建解决方案?
How to configure TeamCity to build a solution with 2 projects?
我已经配置了TeamCity来构建我的解决方案,该解决方案有1个项目被选为启动项目",并且构建良好.
I have configured TeamCity to build my solution which has 1 project which is chosen as Startup Project and it builds fine.
我通过在其WebUI中添加一个新的运行人员"类型为"Visual Studio(sln)"的构建步骤来对其进行配置.
I configured it by adding a new Build Step with Runner Type of "Visual Studio (sln)" from its WebUI.
我添加了一个新的类库项目,并从第一个项目中添加了对它的引用,并且在本地构建良好.
I added a new class library project and added a reference to it from the first project and it builds fine locally.
第一个项目的.csproj文件现在包含以下内容:
The .csproj file of the first project now contains this:
<ItemGroup>
<ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj">
<Project>{00E69E26-2576-4B9A-9180-CB1877B1D951}</Project>
<Name>ClassLibrary1</Name>
</ProjectReference>
</ItemGroup>
我检查了代码,teamcity无法建立!
I checked in the code and teamcity fails to build!
error CS0246: The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?)
TeamCity似乎仅构建了启动项目,而没有引用ClassLibrary1.
TeamCity seems to only build the startup project not the ClassLibrary1 although it's referenced.
如何配置它来构建我的解决方案?
How could I configure it to build my solution?
使用WebUI可以做到这一点吗? MSBuild脚本?
Would this be possible using the WebUI or I should be writing e.g. MSBuild scripts?
谢谢
推荐答案
实际上,问题在于TeamCity正在缓存,因为解决方案是从版本控制设置"中选中以下复选框:
Actually, the problem was TeamCity was caching because and the solution was to check the below check box from the Version Control Settings:
代理结帐:强制覆盖所有文件
之所以要缓存,是因为我使用的是自动在服务器上"的Checkout模式,这意味着它将缓存:
The reason it was caching was that I'm using the Checkout mode of "Automatically on server" which means it will cache: http://confluence.jetbrains.net/display/TCD65/VCS+Checkout+Mode
这篇关于如何配置TeamCity以使用2个项目构建解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!