Build/Test Issues

NCrunch silently failing to build a project.

Started by otac0n on 12,750 views

We have NVrunch failing to build a project, but it does not show an error message in the test window.

Here is the (sanitized) output when I browse to the workspace and build the project with MSBuild:

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.261]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 3/11/2012 2:51:38 PM.
Project "D:\NCrunch\17700\143\Web\Members\Web.Members\Web.Members.csproj" on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
  Web.Members -> D:\NCrunch\17700\143\Web\Members\Web.Members\bin\Web.Members.dll
NCrunchOutputFileQuery:
  #NCRUNCH_OutputFile='bin\Web.Members.dll'
Done Building Project "D:\NCrunch\17700\143\Web\Members\Web.Members\Web.Members.csproj" (default targets).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.35


The NCrunch output window also shows nothing when I ask NCrunch to rebuild the project.
I was able to get NCrunch to be happy about the project by removing one of the project references.

This is confusing becuase that project is referenced by many other projects in our solution and NCrunch is able to build them just fine.
Can you describe the symptoms of the failure in more detail? Was the failing project shown with an X in the Tests Window? Was the build failure actually correct (i.e. was it supposed to have failed)?
As far as I can tell, it should not have failed the build, but it was showing with an X in the tests window.

In order to try to reproduce the error, I "browsed to the last build workspace for the project" and ran MSBuild, which succeeded, as seen in my initial post.
Were there any details showing in the processing queue?

Often if NCrunch encounters an internal error, it will only show the details of the error in the processing queue. Most likely this had little to do with your build, and it was caused by a defect somewhere in the NCrunch engine. If you can get it to happen again, can you submit a bug report?
Here is what seems to be the root of the problem, when I turn on detailed logging:

[19:04:46.3547-BuildTask-39] ERROR (Internal): System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents)
   at nCrunch.Core.BuildTask.DoProcessTaskAndReturnSuccessFlag()
   at nCrunch.Core.Processing.ProcessingTask.ProcessTaskAndReturnSuccessFlag()
   at nCrunch.Core.Processing.ProcessingQueue.#=q_vrMx4Vpdr8SHIA907gDpw==(ProcessingTask #=qnFdWWU2KDBGY_Tb0$G9s3A==)
Gotcha. Are you able to check the build revision of NCrunch that you're using? The version of NCrunch that was initially pushed out with 1.38 (1.38.0.16) has this problem. Because of early reports and knowing that it was easy to fix, I implemented a fix and dropped a new revision out on the download page (1.38.0.17) that shouldn't be throwing this exception. If you're using the old revision, do give the new one a try and let me know if this solves the problem.
This fixed it, btw.

Post a reply

Log in to reply.