Just started seeing build error on a build that was working until we upgraded the build agent to TFS 2013.3
Exception Message: Stack empty. (type InvalidOperationException)
Exception Stack Trace: at Microsoft.VisualStudio.TestImpact.Analysis.LanguageSignatureParser.NotifyEndType()
at Microsoft.VisualStudio.TestImpact.Analysis.SigParser.ParseType()
at Microsoft.VisualStudio.TestImpact.Analysis.SigParser.ParseRetType()
at Microsoft.VisualStudio.TestImpact.Analysis.SigParser.ParseMethod(Byte num1)
at Microsoft.VisualStudio.TestImpact.Analysis.SigParser.Parse(Byte\* blob, UInt32 len)
at Microsoft.VisualStudio.TestImpact.Analysis.LanguageSignatureParser.ParseMethodName(MethodProps methodProps, String& typeName, String& fullName)
at Microsoft.VisualStudio.TestImpact.Analysis.AssemblyMethodComparer.AddChangeToList(DateTime now, List\`1 changes, CodeChangeReason reason, MethodInfo methodInfo, MetadataReader metadataReader, Guid assemblyIdentifier, SymbolReader symbolsReader, UInt32 sourceToken, LanguageSignatureParser& languageParser)
at Microsoft.VisualStudio.TestImpact.Analysis.AssemblyMethodComparer.CompareAssemblies(String firstPath, String secondPath, Boolean lookupSourceFiles)
at Microsoft.TeamFoundation.TestImpact.BuildIntegration.BuildActivities.GetImpactedTests.CompareBinary(CodeActivityContext context, String sharePath, String assembly, IList\`1 codeChanges)
at Microsoft.TeamFoundation.TestImpact.BuildIntegration.BuildActivities.GetImpactedTests.CompareBuildBinaries(CodeActivityContext context, IBuildDefinition definition, IList\`1 codeChanges)
at Microsoft.TeamFoundation.TestImpact.BuildIntegration.BuildActivities.GetImpactedTests.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I assume the issue is a DLL mismatch between what is installed in as part of the build agent and something in the 2012 generation build process template in use.
As an immediate fix, until I get a chance to swap the template to a newer one, was to disable Test Impact Analysis, which I was not using for this project anyway.
Once I did this my build completed OK with the tests ran OK