Nant build that calls MSBuild: works via command runner but not via Nant?
Hi,
I'm building an existing project via a Nant build, which invokes the Nant-contrib msbuild task to compile individual assembly .csproj files.
I can make it all compile when I use the Command Line runner to invoke Nant. When I use the Nant runner to invoke Nant, it behaves differently:
-
: Complete build sequence is
: msbuild (12s)
: Starting MSBuild...
: Starting 'c:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe (@"D:\work\projects\MyProject\trunk\Assemblies\MyProject.Core\MyProject.Core.csproj.teamcity.msbuild.tcargs")' in 'D:\work\projects\MyProject\trunk'
: Project "MyProject.Core.csproj.teamcity.patch.tcprojx" (default targets): (10s)
: [Project "MyProject.Core.csproj.teamcity.patch.tcprojx" (default targets):] Building with tools version "2.0".
: [Project "MyProject.Core.csproj.teamcity.patch.tcprojx" (default targets):] Target "_CheckForInvalidConfigurationAndPlatform" in project "MyProject.Core.csproj.teamcity.patch.tcprojx" (<1s)
: [Target "_CheckForInvalidConfigurationAndPlatform" in project "MyProject.Core.csproj.teamcity.patch.tcprojx"] Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ).
: [Target "_CheckForInvalidConfigurationAndPlatform" in project "MyProject.Core.csproj.teamcity.patch.tcprojx"] Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ).
: [Target "_CheckForInvalidConfigurationAndPlatform" in project "MyProject.Core.csproj.teamcity.patch.tcprojx"] Using "Message" task from assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
: [Target "_CheckForInvalidConfigurationAndPlatform" in project "MyProject.Core.csproj.teamcity.patch.tcprojx"] Configuration=Debug
-
What are the tcproxj and tcargs files for? It looks to me like this bevahiour shouldn't be taking place.
Running TeamCity Professional Version 3.1.2 (build 6881)
Thanks
Julian
Please sign in to leave a comment.
TeamCity replaces call to task from NAnt contrib with it's own one. It's done to provide logging from msbuild process. Please, write the usage(s) of ]]> task in your build script. Thanks!
Hi Eugene,
-
My build looks like this:
]]>
</target>
-
Is there a way to tell your customised msbuild task to use the .NET 3.5 tools?
Best
Julian
You may select .NET 3.5 as your target framework or set 'teamcity_dotnet_use_msbuild_v35' NAnt property
Thanks!
I am having the same problem now because my project was built with VS 2010 and needs msbuild 4. Is there a way to tell team city to not replace my calls to msbuild? Is there a way to tell Team City to use msbuild 4?
You may set NAnt target framework to 'net-4.0' (you will need to patch NAnt.exe.Config file to make it support .NET 4.0)
or
set 'teamcity_dotnet_tools_version' NAnt property with value '4.0'.