I have a large solution that uses many dll-based (not project-based) assembly references. I excitedly grabbed the new v2.6 build this morning in order to try out the inferred project references support. Unfortunately, when I enable this on my solution (change the "Infer project references using assembly names" to True), I get internal exceptions from NCrunch in several projects (both tests and non-test assemblies):
Quote:
[08:26:32.8991-LocalBuildTask-4] 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 System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, CustomEnvironmentVariable[] customEnvironmentVariables)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.ProcessingQueue.#=qtgmBBzjvQuenvycAjq6EQA==(LocalProcessingTask #=qJXDGE9CULxgcfKpGkTRyMA==)
Note that the same assembly that had the above exception message in the Processing Queue shows this warning message in the Tests windows (as expected):
Quote:
It has been detected that this component is referencing assemblies within the build output directories of projects within this solution. It is strongly recommended that assemblies are referenced from a directory location that is not subject to disruption from the build process.
Directly referencing assemblies that are updated, copied or manipulated by the build of projects in this solution will create implicit build dependencies that cannot be tracked by NCrunch or MSBuild. This can result in inconsistent build behaviour patterns and code versioning issues. It can also cause problems when trying to execute a clean build of the solution after it is checked out of a source control system.
The following assembly references have triggered this warning:
C:\Work\XXX\Branches\MyProject\bin\YYY.Common.dll
C:\Work\XXX\Branches\MyProject\bin\YYY.Common.pdb
I currently have four instances of projects with the "An item with the same key has already been added" error. I many more instances of the "Assemblies are being referenced from the build output directories" warnings, so it doesn't appear to be a 1-1 match between the two.