Search code examples
c#dockercakebuild

Cake script works locally, but fails on docker env - error CS0117


I have added few lines to working cake build script. It executes properly on my local machine, but when trying to implement it on docker, where it worked fine till now - it gives me error:

error CS0117: 'NUnit3Settings' does not contain a definition for 'HandleExitCode'

This is what was added:

        var settings = new NUnit3Settings
        {
        HandleExitCode = exitCode => exitCode switch {
        0 => true,
        1 => throw new CakeException("Failed unit tests"),
        _ => false // everything else will throw via default implementation
        }

What am I missing in docker env?


Solution

  • The HandleExitCode was added for the Cake 1.0.0 release. My guess would be that you are using a Cake version before 1.0.0 in your docker environment.