Nant logging listener causes msbuild to blow up

This is in

As there is a known bug regarding hanging builds running from cmd - i decided to use the nant runner.

However - running it causes msbuild to blow up.

  [msbuild] MSBUILD : error MSB1025: An internal  failure occurred while running MSBuild.

if i muck about on the command line and delete the following lines:


then msbuild works properly.

I am using nantcontrib-0.86-nightly-2009-02-01. - but even if i comment out the load tasks line from that (so presumably its using the TC msbuild task) then it still blows up.

I am using .net framework 3.5 (installed not from visual studio - so i have version 6.1, not 6.0a.

any suggestions gladly received.



Comment actions Permalink


Could you please provide server logs and thread dump of the hanged process. Also please details which task causes hang.

Comment actions Permalink

nope - this isn't about a hung build - this is about msbuild just blowing up...

the blow up looks like this:

Target(s) specified: ci.unit

[echo] Building MyApplication-
[loadtasks] Scanning assembly "NAnt.Contrib.Tasks" for extensions.
[loadtasks] Scanning assembly "Macrodef" for extensions.
[macrodef] Scanning assembly "pemgfe9a" for extensions.
[macrodef] Scanning assembly "l26-benr" for extensions.
[macrodef] Scanning assembly "prk5lr07" for extensions.



[set-assembly-version] assembly-info-file = 'PBT\AssemblyInfo.cs', assembly-version = ''
[script] Scanning assembly "m3jexl-l" for extensions.
[msbuild] MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
[msbuild] Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
[msbuild] at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, BuildPropertyGroup propertyBag, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse)
[msbuild] at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
[msbuild] at Microsoft.Build.CommandLine.MSBuildApp.Main()

BUILD FAILED - 0 non-fatal error(s), 5 warning(s)

External Program Failed: msbuild (return code was -1073741819)

So, no hang - just blown up msbuild... :-(

Comment actions Permalink

ok so i found that if i edited the tcargs file from this:


to this


ie got rid of the verbosity - it doesn't blow up.... hmmm.... now to try to make this not happen from the build itself......

Comment actions Permalink

Could you please check if NAnt/msbuild will work if start MSBuild from commandline.

Please attach the part of NAnt script where msbuild is started.

Comment actions Permalink

Yes - all the detail you need is in the post i think.

it does work form the command line - i said that already. I've included two versions of the msbuild args - one that works, and one that doesn't.

is there any more info you need?



Comment actions Permalink


Do you start msbuild.exe from commandline using <Exec> task? What will be the result if start msbuild in that way.

Could you please attach a part of NAnt script that starts msbuild (using <msbuild> task).

Comment actions Permalink

<msbuild project="PBT.sln" verbosity="${msbuild-verbosity}">
      <property name="Configuration" value="${msbuild-configuration}"/>

Comment actions Permalink

Could you please try the following:
- start msbuild using <msbuild> task with verbosity set to 'diag': /verbosity:diag
- start msbuidl using <exec> task of NAnt

Make sure you set 'teamcity.agent.dotnet.debug' build property with value 'true' in the build configuration settings.

Please attach produced build logs.

Do you have any msbuild extensions installed for MSBuild?


Please sign in to leave a comment.