Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Teamcity not building my .SLN in release mode

I have created a release configuration project in Teamcity 6.5 using the "SLN Runner" for VS 2008 solutions. My debug solution builds fine along with the PDB files - however I simply cannot get the thing to build in Release mode, plus it will insist on defaulting to x64 architecture.

I have tried the following:

  • Set proj file explicitly to Release mode
  • Set build parameters to send to MSBuild explicitly passing through /platform:anycpu and /configuration:release

I've noticed in the .sln.proj file that is generated that the following code appears (at first glance) to be incorrect and the configs are being set to Debug mode for both configurations?

 <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>

Any assistance appreciated:

like image 335
8 revs Avatar asked Aug 15 '11 16:08

8 revs


People also ask

How do I build a project in release mode?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).

How do I enable build step in TeamCity?

In Build Steps, click Auto-detect build steps, and then select the proposed steps you want to add to the current build configuration. You can change their settings afterwards.

How do you make a build on TeamCity?

Go to Administration | Projects and open the required project. Alternatively, open the project using the Projects pop-up menu and click Edit Project Settings. The Project Settings page will open. On the Project Settings page, click Create build configuration under the Build Configurations section.

How do I use TeamCity with Visual Studio?

Installing Add-inNavigate to the download page of the Visual Studio Add-in: Click the arrow next to your username in the top right corner of the TeamCity web UI and select Profile. In the TeamCity Tools section on the right, click the Visual Studio Add-in download link.


1 Answers

May sound stupid but does all the Projects in your solution contain an Any CPU platform configuration for Release?

This has caught us out a few times with some projects only pointing at x86 etc

like image 158
Siy Williams Avatar answered Sep 28 '22 02:09

Siy Williams