In order to debug the issue in CSHARP-2371, I needed to increase the verbosity of cake to Diagnostic. This should be the default since it will aid in debugging similar problems in the future, and does not have a significant impact on the verbosity of the build.
With the default verbosity, I would get this output:
Copying file DnsClient.xml to C:/data/mci/8d02bdce5437b7a9c099c62324f7e77f/mongo-csharp-driver/artifacts/bin/net45/DnsClient.xml Error: One or more errors occurred. Finished executing task: BuildNet45 Command failed: command [pid=3808] encountered problem: exit status 1 Task completed - FAILURE.
With Diagnostic verbosity, I get this output which is much clearer:
Copying file DnsClient.xml to C:/data/mci/a0269cd9eee1320187779753221391a5/mongo-csharp-driver/artifacts/bin/net45/DnsClient.xml
Finished executing task: BuildNet45
Error: System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
at Cake.Git.GitAliases.GitCheckout(ICakeContext context, DirectoryPath repositoryDirectoryPath, String committishOrBranchSpec, FilePath[] filePaths)
at Cake.Git.GitAliases.GitCheckout(ICakeContext context, DirectoryPath repositoryDirectoryPath, FilePath[] filePaths)
at Submission#0.GlobalAssemblyInfo.RestoreGlobalAssemblyInfoFile(ICakeContext context, DirectoryPath solutionDirectory)
at Submission#0.<<Initialize>>b__0_2()
at Cake.Core.DefaultExecutionStrategy.InvokeFinally(Action action)
at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report)
at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target)
at Cake.Scripting.BuildScriptHost.RunTarget(String target)
at Submission#0.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Cake.Scripting.Roslyn.RoslynScriptSession.Execute(Script script)
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
at Cake.Commands.BuildCommand.Execute(CakeOptions options)
at Cake.CakeApplication.Run(CakeOptions options)
at Cake.Program.Main()
---> (Inner Exception #0) System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
File name: 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Cake.Git.GitAliases.GitCheckout(ICakeContext context, DirectoryPath repositoryDirectoryPath, String committishOrBranchSpec, FilePath[] filePaths)
at Cake.Git.GitAliases.GitCheckout(ICakeContext context, DirectoryPath repositoryDirectoryPath, FilePath[] filePaths)
at Submission#0.GlobalAssemblyInfo.RestoreGlobalAssemblyInfoFile(ICakeContext context, DirectoryPath solutionDirectory)
at Submission#0.<<Initialize>>b__0_2()
at Cake.Core.DefaultExecutionStrategy.InvokeFinally(Action action)
at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report)
at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target)
at Cake.Scripting.BuildScriptHost.RunTarget(String target)
at Submission#0.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
<---
Command failed: command [pid=1428] encountered problem: exit status 1
Task completed - FAILURE.