我使用“SLN Runner”在 Teamcity 6.5 中为 VS 2008 解决方案创建了一个发布配置项目。我的调试解决方案与 PDB 文件一起构建得很好——但是我根本无法在 Release模式下构建它,而且它会坚持默认为 x64 架构。
我尝试了以下方法:
- 明确设置proj文件为Release模式
- 设置构建参数以显式通过/platform:anycpu 和/configuration:release 发送到 MSBuild
我注意到在生成的 .sln.proj 文件中,以下代码似乎(乍一看)不正确,并且两种配置的配置都设置为 Debug模式?
<ItemGroup Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') ">
<BuildLevel0 Include="MySolution.csproj">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</BuildLevel0>
</ItemGroup>
<ItemGroup Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') ">
<BuildLevel0 Include="MySolution.csproj">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</BuildLevel0>
</ItemGroup>
感谢任何帮助:
最佳答案
可能听起来很愚蠢,但您的解决方案中的所有项目是否都包含用于发布的任何 CPU
平台配置?
这让我们陷入了困境,一些项目只指向 x86 等
关于c# - Teamcity 未在 Release模式下构建我的 .SLN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7067477/