Cake: Cannot run csproj file with NUnit3 tool

Created on 26 Sep 2018  Â·  14Comments  Â·  Source: cake-build/cake

What You Are Seeing?

When I try to run a csproj file containing unit tests using the Cake NUnit3 tool, it fails saying that it is not a supported file type.

What is Expected?

The NUnit3 console runner does support csproj files, so I expect that Cake should support them when using NUnit3 also. I have a test project that has binding redirects, so if I just run the dll in NUnit, it will fail because it can't resolve the dependencies, so I need to use the csproj file.

What version of Cake are you using?

I think 0.30.0. I don't know how to check, but I downloaded it on 9/24/2018.

Are you running on a 32 or 64 bit system?

What environment are you running on? Windows? Linux? Mac?

Windows 10, 64 bit

Are you running on a CI Server? If so, which one?

No

How Did You Get This To Happen? (Steps to Reproduce)

The code belongs to my company, so I cannot share, but here are the basic steps:

  • Create a test project.
  • Install a nuget package in the test project.
  • Reference a class defined in that nuget package in a test.
  • Build the project. The dll's from the nuget package do not show up in the output directory of the test project.
  • Run a Cake script to run the test project's DLL. I'm getting this error here

    Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

  • Change to targeting csproj instead of dll files in the Cake script. Then I get this error:

    Invalid : C:GitpathToMyProject.csproj File type is not supported

  • Try running the same thing using the NUnit console runner in powershell nunit3 C:\Git\pathToMyProject.csproj and it works.

Output Log

========================================
Run-Ccmp-Unit-Tests
========================================
Executing task: Run-Ccmp-Unit-Tests
Executing: "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe" "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Application/Ccmp.Tests.Unit.Application.csproj" "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Domain/Ccmp.Tests.Unit.Domain.csproj" "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Infrastructure/Ccmp.Tests.Unit.Infrastructure.csproj" "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Localization/Ccmp.Tests.Unit.Localization.csproj" "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Service.Rest/Ccmp.Tests.Unit.Service.Rest.csproj" "C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.SqlConnectionManager/Ccmp.Tests.Unit.SqlConnectionManager.csproj"
NUnit Console Runner 3.9.0
Copyright (c) 2018 Charlie Poole, Rob Prouse

Runtime Environment
   OS Version: Microsoft Windows NT 10.0.16299.0
  CLR Version: 4.0.30319.42000

Test Files
    C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Application/Ccmp.Tests.Unit.Application.csproj
    C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Domain/Ccmp.Tests.Unit.Domain.csproj
    C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Infrastructure/Ccmp.Tests.Unit.Infrastructure.csproj
    C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Localization/Ccmp.Tests.Unit.Localization.csproj
    C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.Service.Rest/Ccmp.Tests.Unit.Service.Rest.csproj
    C:/Git/PowerDMS_Org/PowerDMS/utils/cake/../../tests/services/api/unit/Ccmp.Tests.Unit.SqlConnectionManager/Ccmp.Tests.Unit.SqlConnectionManager.csproj


Errors, Failures and Warnings

1) Invalid : C:\Git\PowerDMS_Org\PowerDMS\tests\services\api\unit\Ccmp.Tests.Unit.Application\Ccmp.Tests.Unit.Application.csproj
File type is not supported

2) Invalid : C:\Git\PowerDMS_Org\PowerDMS\tests\services\api\unit\Ccmp.Tests.Unit.Domain\Ccmp.Tests.Unit.Domain.csproj
File type is not supported

3) Invalid : C:\Git\PowerDMS_Org\PowerDMS\tests\services\api\unit\Ccmp.Tests.Unit.Infrastructure\Ccmp.Tests.Unit.Infrastructure.csproj
File type is not supported

4) Invalid : C:\Git\PowerDMS_Org\PowerDMS\tests\services\api\unit\Ccmp.Tests.Unit.Localization\Ccmp.Tests.Unit.Localization.csproj
File type is not supported

5) Invalid : C:\Git\PowerDMS_Org\PowerDMS\tests\services\api\unit\Ccmp.Tests.Unit.Service.Rest\Ccmp.Tests.Unit.Service.Rest.csproj
File type is not supported

6) Invalid : C:\Git\PowerDMS_Org\PowerDMS\tests\services\api\unit\Ccmp.Tests.Unit.SqlConnectionManager\Ccmp.Tests.Unit.SqlConnectionManager.csproj
File type is not supported

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2018-09-26 10:26:39Z
    End time: 2018-09-26 10:26:41Z
    Duration: 1.187 seconds

Results (nunit3) saved as TestResult.xml
An error occurred when executing task 'Run-Ccmp-Unit-Tests'.
Error: System.AggregateException: One or more errors occurred. ---> Cake.Core.CakeException: NUnit3: Invalid test fixture (exit code -4).
   at Cake.Common.Tools.NUnit.NUnit3Runner.ProcessExitCode(Int32 exitCode)
   at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction)
   at Cake.Common.Tools.NUnit.NUnit3Runner.Run(IEnumerable`1 assemblyPaths, NUnit3Settings settings)
   at Submission#0.NUnit3(IEnumerable`1 assemblies, NUnit3Settings settings)
   at Submission#0.<<Initialize>>b__0_13()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass20_0.<Does>b__0(ICakeContext x)
   at Cake.Core.CakeTask.<Execute>d__43.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 Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d__4.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 Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.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 Cake.Core.CakeEngine.<RunTask>d__28.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 Cake.Core.CakeEngine.<RunTargetAsync>d__27.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 Cake.Scripting.BuildScriptHost.<RunTargetAsync>d__3.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 Cake.Core.Scripting.ScriptHost.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) Cake.Core.CakeException: NUnit3: Invalid test fixture (exit code -4).
   at Cake.Common.Tools.NUnit.NUnit3Runner.ProcessExitCode(Int32 exitCode)
   at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction)
   at Cake.Common.Tools.NUnit.NUnit3Runner.Run(IEnumerable`1 assemblyPaths, NUnit3Settings settings)
   at Submission#0.NUnit3(IEnumerable`1 assemblies, NUnit3Settings settings)
   at Submission#0.<<Initialize>>b__0_13()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass20_0.<Does>b__0(ICakeContext x)
   at Cake.Core.CakeTask.<Execute>d__43.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 Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d__4.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 Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.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 Cake.Core.CakeEngine.<RunTask>d__28.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 Cake.Core.CakeEngine.<RunTargetAsync>d__27.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 Cake.Scripting.BuildScriptHost.<RunTargetAsync>d__3.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 Cake.Core.Scripting.ScriptHost.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()<---

Most helpful comment

Where would the .addins file come from in a situation like this to tell the engine about the VS project loader extension in a separate package directory?

The NUnit.ConsoleRunner package contains an .addins file which has relative paths to locate extensions installed in other NuGet packages. (i.e. - if both console runner and extensions are installed via NuGet, they should be able to find each other.)

tool doesn’t download any dependencies, hence metapackages won’t work. @cake-build/cake-team should we install dependencies for #tool?

Interesting! The NUnit.Console package definitely won't work in that case! My opinion would be that Cake definitely should install dependencies. 🙂

@JamesFaix - based on @mholo65's comment above, try installing these two packages:

#tool nuget:?package=NUnit.ConsoleRunner
#tool nuget:?package=NUnit.Extension.VSProjectLoader

All 14 comments

@JamesFaix while I appreciate that the code that you are seeing the error on is private and you can't share it, but I think it is a lot to ask for us (as the Cake Team) to try to reproduce the error that you are seeing. If possible, can you please create a small sample application, ideally in a GitHub repository, that illustrates the problem that you are seeing. That way, there is no ambiguity about what is, and isn't working. Once you have the reproduction, let us know where we can find the project.

@JamesFaix The ability for NUnit to understand csproj files comes as an optional engine extension.

https://www.nuget.org/packages/NUnit.ConsoleRunner/ has no extensions, but https://www.nuget.org/packages/NUnit.Console/ has:

 * NUnitProjectLoader     - loads tests from NUnit projects
 * VSProjectLoader        - loads tests from Visual Studio projects
 * NUnitV2ResultWriter    - saves results in NUnit V2 format.
 * NUnitV2FrameworkDriver - runs NUnit V2 tests.
 * TeamCityEventListener - supports special progress messages used by teamcity.

Are you using #tool NUnit.Console in your .cake file?

@JamesFaix Would be great if you can give us feedback whether or not @jnm2's suggestion solved your problem when you've had a chance to try it out.

I was running it using NUnit.ConsoleRunner before. I am trying to use NUnit.Console now, but I get the error

Error: Failed to install addin 'NUnit.Console'

when I add

#addin nuget:?package=NUnit.Console

to the top of my script.

@JamesFaix I think you want #tool. #addin is for assemblies that Cake loads in-process; #tool is for command-line utilities that Cake runs as separate processes. Built-in Cake aliases like NUnit3 expect to run external processes.

(More info at https://cakebuild.net/docs/fundamentals/preprocessor-directives.)

I switched to #tool but I still got a very similar error

PS C:\Git\PowerDMS_Org\PowerDMS\utils\cake> .\build.ps1 -target run-ccmp-unit-tests -Verbose
Preparing to run build script...
VERBOSE: Restoring tools from NuGet...
VERBOSE: Feeds used:
  C:\Users\james.faix\.nuget\packages\
  https://api.nuget.org/v3/index.json

All packages listed in C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\packages.config are already installed.
Running build script...
Error: Failed to install tool 'NUnit.Console'.

Based on that I looked at my tools/packages.config file and it only listed Cake, not NUnit.Console.

<?xml version="1.0" encoding="utf-8"?>
<packages> 
    <package id="Cake" version="0.30.0" />
</packages>

I added NUnit.Console to that and tried again

<?xml version="1.0" encoding="utf-8"?>
<packages> 
    <package id="Cake" version="0.30.0" />
    <package id="NUnit.Console" version="3.9.0" />
</packages>
PS C:\Git\PowerDMS_Org\PowerDMS\utils\cake> .\build.ps1 -target run-ccmp-unit-tests -Verbose
Preparing to run build script...
VERBOSE: Missing or changed package.config hash...
VERBOSE: Restoring tools from NuGet...
VERBOSE: Feeds used:
  C:\Users\james.faix\.nuget\packages\
  https://api.nuget.org/v3/index.json

Restoring NuGet package NUnit.Console.3.9.0.
Restoring NuGet package Cake.0.30.0.
Adding package 'Cake.0.30.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Adding package 'NUnit.Console.3.9.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Added package 'NUnit.Console.3.9.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Added package 'Cake.0.30.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Running build script...
Error: Failed to install tool 'NUnit.Console'.

I noticed that the nupkg that its downloading is only 12kb, does that seem right?

Here is diagnostic level output

Error: Failed to install tool 'NUnit.Console'.
PS C:\Git\PowerDMS_Org\PowerDMS\utils\cake> .\build.ps1 -target run-ccmp-unit-tests -Verbosity Diagnostic
Preparing to run build script...
Running build script...
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing C:/Git/PowerDMS_Org/PowerDMS/utils/cake/build.cake...
Processing build script...
Installing tools...
Found package 'NUnit.Console 3.9.0' in 'C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools'.
Package NUnit.Console.3.9.0 has already been installed.
Successfully installed 'NUnit.Console 3.9.0' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools
Executing nuget actions took 38.13 ms
Error: Cake.Core.CakeException: Failed to install tool 'NUnit.Console'.
   at Cake.Core.Scripting.ScriptProcessor.InstallPackages(IReadOnlyCollection`1 modules, DirectoryPath installPath, PackageType packageType)
   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()

I noticed that the nupkg that its downloading is only 12kb, does that seem right?

Yes, NuGet.Console is a metapackage that merely references these packages:

NUnit.ConsoleRunner (>= 3.9.0)
NUnit.Extension.NUnitProjectLoader (>= 3.5.0)
NUnit.Extension.NUnitV2Driver (>= 3.6.0)
NUnit.Extension.NUnitV2ResultWriter (>= 3.5.0)
NUnit.Extension.TeamCityEventListener (>= 1.0.3)
NUnit.Extension.VSProjectLoader (>= 3.8.0)

I'm not familiar with why #tool would error. (Cake team, any ideas?) You could try adding #tool references to NUnit.ConsoleRunner and NUnit.Extension.VSProjectLoader directly.

@ChrisMaddock can I bug you about this one? Where would the .addins file come from in a situation like this to tell the engine about the VS project loader extension in a separate package directory?

@jnm2, #tool doesn’t download any dependencies, hence metapackages won’t work. @cake-build/cake-team should we install dependencies for #tool?

Where would the .addins file come from in a situation like this to tell the engine about the VS project loader extension in a separate package directory?

The NUnit.ConsoleRunner package contains an .addins file which has relative paths to locate extensions installed in other NuGet packages. (i.e. - if both console runner and extensions are installed via NuGet, they should be able to find each other.)

tool doesn’t download any dependencies, hence metapackages won’t work. @cake-build/cake-team should we install dependencies for #tool?

Interesting! The NUnit.Console package definitely won't work in that case! My opinion would be that Cake definitely should install dependencies. 🙂

@JamesFaix - based on @mholo65's comment above, try installing these two packages:

#tool nuget:?package=NUnit.ConsoleRunner
#tool nuget:?package=NUnit.Extension.VSProjectLoader

Adding the two separate tool directives gets me to here:

PS C:\Git\PowerDMS_Org\PowerDMS\utils\cake> .\build.ps1 -target run-ccmp-unit-tests -Verbosity Diagnostic
Preparing to run build script...
Running build script...PowerDMS\utils\cake>
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing C:/Git/PowerDMS_Org/PowerDMS/utils/cake/build.cake...
Processing build script...
Installing tools...
  GET https://api.nuget.org/v3/registration3-gz-semver2/nunit.consolerunner/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/nunit.consolerunner/index.json 127ms
Retrieving package 'NUnit.ConsoleRunner 3.9.0' from 'C:\Users\james.faix\.nuget\packages\'.
Adding package 'NUnit.ConsoleRunner.3.9.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Added package 'NUnit.ConsoleRunner.3.9.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Added package 'NUnit.ConsoleRunner.3.9.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools' from source 'C:\Users\james.faix\.nuget\packages\'
Successfully installed 'NUnit.ConsoleRunner 3.9.0' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools
Executing nuget actions took 431.31 ms
  GET https://api.nuget.org/v3/registration3-gz-semver2/nunit.extension.vsprojectloader/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/nunit.extension.vsprojectloader/index.json 245ms
Missing C:\Users\james.faix\.nuget\packages\nunit.extension.vsprojectloader\3.8.0\nunit.extension.vsprojectloader.3.8.0.nupkg
  CACHE https://api.nuget.org/v3/registration3-gz-semver2/nunit.extension.vsprojectloader/index.json
Retrieving package 'NUnit.Extension.VSProjectLoader 3.8.0' from 'nuget.org'.
  GET https://api.nuget.org/v3-flatcontainer/nunit.extension.vsprojectloader/3.8.0/nunit.extension.vsprojectloader.3.8.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/nunit.extension.vsprojectloader/3.8.0/nunit.extension.vsprojectloader.3.8.0.nupkg 166ms
Acquiring lock for the installation of NUnit.Extension.VSProjectLoader 3.8.0
Acquired lock for the installation of NUnit.Extension.VSProjectLoader 3.8.0
Installing NUnit.Extension.VSProjectLoader 3.8.0.
Completed installation of NUnit.Extension.VSProjectLoader 3.8.0
Adding package 'NUnit.Extension.VSProjectLoader.3.8.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Added package 'NUnit.Extension.VSProjectLoader.3.8.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools'
Added package 'NUnit.Extension.VSProjectLoader.3.8.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools' from source 'https://api.nuget.org/v3/index.json'
Successfully installed 'NUnit.Extension.VSProjectLoader 3.8.0' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools
Executing nuget actions took 1.47 sec
Installing addins...
  GET https://api.nuget.org/v3/registration3-gz-semver2/cake.iis/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/cake.iis/index.json 282ms
Retrieving package 'Cake.IIS 0.4.1' from 'C:\Users\james.faix\.nuget\packages\'.
Adding package 'Cake.IIS.0.4.1' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Cake.IIS.0.4.1' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Cake.IIS.0.4.1' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins' from source 'C:\Users\james.faix\.nuget\packages\'
Successfully installed 'Cake.IIS 0.4.1' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools/Addins
Executing nuget actions took 66.72 ms
The addin Cake.IIS will reference Cake.IIS.dll.
The addin Cake.IIS will reference Microsoft.Web.Administration.dll.
  GET https://api.nuget.org/v3/registration3-gz-semver2/cake.npm/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/cake.npm/index.json 234ms
Retrieving package 'Cake.Npm 0.15.0' from 'C:\Users\james.faix\.nuget\packages\'.
Adding package 'Cake.Npm.0.15.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Cake.Npm.0.15.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Cake.Npm.0.15.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins' from source 'C:\Users\james.faix\.nuget\packages\'
Successfully installed 'Cake.Npm 0.15.0' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools/Addins
Executing nuget actions took 55.21 ms
The addin Cake.Npm will reference Cake.Npm.dll.
  GET https://api.nuget.org/v3/registration3-gz-semver2/cake.services/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/cake.services/index.json 220ms
Retrieving package 'Cake.Services 0.3.5' from 'C:\Users\james.faix\.nuget\packages\'.
Adding package 'Cake.Services.0.3.5' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Cake.Services.0.3.5' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Cake.Services.0.3.5' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins' from source
'C:\Users\james.faix\.nuget\packages\'
Successfully installed 'Cake.Services 0.3.5' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools/Addins
Executing nuget actions took 76.14 ms
The addin Cake.Services will reference Cake.Powershell.dll.
The addin Cake.Services will reference Cake.Services.dll.
The addin Cake.Services will reference System.Management.Automation.dll.
  GET https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/index.json 230ms
Retrieving package 'Newtonsoft.Json 11.0.2' from 'C:\Users\james.faix\.nuget\packages\'.
Adding package 'Newtonsoft.Json.11.0.2' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Newtonsoft.Json.11.0.2' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'Newtonsoft.Json.11.0.2' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins' from source 'C:\Users\james.faix\.nuget\packages\'
Successfully installed 'Newtonsoft.Json 11.0.2' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools/Addins
Executing nuget actions took 159.03 ms
The addin Newtonsoft.Json will reference Newtonsoft.Json.dll.
  GET https://api.nuget.org/v3/registration3-gz-semver2/system.serviceprocess.servicecontroller/index.json
  OK https://api.nuget.org/v3/registration3-gz-semver2/system.serviceprocess.servicecontroller/index.json 253ms
Retrieving package 'System.ServiceProcess.ServiceController 4.5.0' from 'C:\Users\james.faix\.nuget\packages\'.
Adding package 'System.ServiceProcess.ServiceController.4.5.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'System.ServiceProcess.ServiceController.4.5.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins'
Added package 'System.ServiceProcess.ServiceController.4.5.0' to folder 'C:\Git\PowerDMS_Org\PowerDMS\utils\cake\tools\Addins' from source 'C:\Users\james.faix\.nuget\packages\'
Successfully installed 'System.ServiceProcess.ServiceController 4.5.0' to C:/Git/PowerDMS_Org/PowerDMS/utils/cake/tools/Addins
Executing nuget actions took 138.47 ms
The addin System.ServiceProcess.ServiceController will reference System.ServiceProcess.ServiceController.dll.
The addin System.ServiceProcess.ServiceController will reference System.ServiceProcess.ServiceController.dll.
Verifying assembly 'Cake.IIS, Version=0.4.1.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Microsoft.Web.Administration, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Verifying assembly 'Cake.Npm, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.Powershell, Version=0.4.6.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.Services, Version=0.3.5.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Verifying assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
Verifying assembly 'System.ServiceProcess.ServiceController, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Verifying assembly 'System.ServiceProcess.ServiceController, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Adding assembly reference to mscorlib.dll...
Adding assembly reference to System.Core.dll...
Adding assembly reference to Cake.Core.dll...
Adding assembly reference to Cake.Common.dll...
Adding assembly reference to Cake.exe...
Adding assembly reference to System.dll...
Adding assembly reference to System.Xml.dll...
Adding assembly reference to System.Xml.Linq.dll...
Adding assembly reference to System.Data.dll...
Adding assembly reference to System.Runtime.dll...
Adding assembly reference to System.Collections.dll...
Adding assembly reference to netstandard.dll...
Adding assembly reference to Cake.IIS.dll...
Adding assembly reference to Microsoft.Web.Administration.dll...
Adding assembly reference to Cake.Npm.dll...
Adding assembly reference to Cake.Powershell.dll...
Adding assembly reference to Cake.Services.dll...
Adding assembly reference to System.Management.Automation.dll...
Adding assembly reference to Newtonsoft.Json.dll...
Adding assembly reference to System.ServiceProcess.ServiceController.dll...
Importing namespace Cake.Common...
Importing namespace Cake.Common.Build...
Importing namespace Cake.Common.Build.AppVeyor...
Importing namespace Cake.Common.Build.AppVeyor.Data...
Importing namespace Cake.Common.Build.Bamboo...
Importing namespace Cake.Common.Build.Bamboo.Data...
Importing namespace Cake.Common.Build.BitbucketPipelines...
Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
Importing namespace Cake.Common.Build.Bitrise...
Importing namespace Cake.Common.Build.Bitrise.Data...
Importing namespace Cake.Common.Build.ContinuaCI...
Importing namespace Cake.Common.Build.ContinuaCI.Data...
Importing namespace Cake.Common.Build.GitLabCI...
Importing namespace Cake.Common.Build.GitLabCI.Data...
Importing namespace Cake.Common.Build.GoCD...
Importing namespace Cake.Common.Build.GoCD.Data...
Importing namespace Cake.Common.Build.Jenkins...
Importing namespace Cake.Common.Build.Jenkins.Data...
Importing namespace Cake.Common.Build.MyGet...
Importing namespace Cake.Common.Build.TeamCity...
Importing namespace Cake.Common.Build.TFBuild...
Importing namespace Cake.Common.Build.TFBuild.Data...
Importing namespace Cake.Common.Build.TravisCI...
Importing namespace Cake.Common.Build.TravisCI.Data...
Importing namespace Cake.Common.Diagnostics...
Importing namespace Cake.Common.IO...
Importing namespace Cake.Common.IO.Paths...
Importing namespace Cake.Common.Net...
Importing namespace Cake.Common.Security...
Importing namespace Cake.Common.Solution...
Importing namespace Cake.Common.Solution.Project...
Importing namespace Cake.Common.Solution.Project.Properties...
Importing namespace Cake.Common.Solution.Project.XmlDoc...
Importing namespace Cake.Common.Text...
Importing namespace Cake.Common.Tools...
Importing namespace Cake.Common.Tools.Cake...
Importing namespace Cake.Common.Tools.Chocolatey...
Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
Importing namespace Cake.Common.Tools.Chocolatey.Config...
Importing namespace Cake.Common.Tools.Chocolatey.Download...
Importing namespace Cake.Common.Tools.Chocolatey.Features...
Importing namespace Cake.Common.Tools.Chocolatey.Install...
Importing namespace Cake.Common.Tools.Chocolatey.New...
Importing namespace Cake.Common.Tools.Chocolatey.Pack...
Importing namespace Cake.Common.Tools.Chocolatey.Pin...
Importing namespace Cake.Common.Tools.Chocolatey.Push...
Importing namespace Cake.Common.Tools.Chocolatey.Sources...
Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
Importing namespace Cake.Common.Tools.DotCover...
Importing namespace Cake.Common.Tools.DotCover.Analyse...
Importing namespace Cake.Common.Tools.DotCover.Cover...
Importing namespace Cake.Common.Tools.DotCover.Merge...
Importing namespace Cake.Common.Tools.DotCover.Report...
Importing namespace Cake.Common.Tools.DotNetCore...
Importing namespace Cake.Common.Tools.DotNetCore.Build...
Importing namespace Cake.Common.Tools.DotNetCore.Clean...
Importing namespace Cake.Common.Tools.DotNetCore.Execute...
Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
Importing namespace Cake.Common.Tools.DotNetCore.Pack...
Importing namespace Cake.Common.Tools.DotNetCore.Publish...
Importing namespace Cake.Common.Tools.DotNetCore.Restore...
Importing namespace Cake.Common.Tools.DotNetCore.Run...
Importing namespace Cake.Common.Tools.DotNetCore.Test...
Importing namespace Cake.Common.Tools.DotNetCore.Tool...
Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
Importing namespace Cake.Common.Tools.DupFinder...
Importing namespace Cake.Common.Tools.Fixie...
Importing namespace Cake.Common.Tools.GitLink...
Importing namespace Cake.Common.Tools.GitReleaseManager...
Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
Importing namespace Cake.Common.Tools.GitReleaseNotes...
Importing namespace Cake.Common.Tools.GitVersion...
Importing namespace Cake.Common.Tools.ILMerge...
Importing namespace Cake.Common.Tools.ILRepack...
Importing namespace Cake.Common.Tools.InnoSetup...
Importing namespace Cake.Common.Tools.InspectCode...
Importing namespace Cake.Common.Tools.MSBuild...
Importing namespace Cake.Common.Tools.MSpec...
Importing namespace Cake.Common.Tools.MSTest...
Importing namespace Cake.Common.Tools.NSIS...
Importing namespace Cake.Common.Tools.NuGet...
Importing namespace Cake.Common.Tools.NuGet.Add...
Importing namespace Cake.Common.Tools.NuGet.Init...
Importing namespace Cake.Common.Tools.NuGet.Install...
Importing namespace Cake.Common.Tools.NuGet.List...
Importing namespace Cake.Common.Tools.NuGet.Pack...
Importing namespace Cake.Common.Tools.NuGet.Push...
Importing namespace Cake.Common.Tools.NuGet.Restore...
Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
Importing namespace Cake.Common.Tools.NuGet.SetProxy...
Importing namespace Cake.Common.Tools.NuGet.Sources...
Importing namespace Cake.Common.Tools.NuGet.Update...
Importing namespace Cake.Common.Tools.NUnit...
Importing namespace Cake.Common.Tools.OctopusDeploy...
Importing namespace Cake.Common.Tools.OpenCover...
Importing namespace Cake.Common.Tools.ReportGenerator...
Importing namespace Cake.Common.Tools.ReportUnit...
Importing namespace Cake.Common.Tools.Roundhouse...
Importing namespace Cake.Common.Tools.SignTool...
Importing namespace Cake.Common.Tools.SpecFlow...
Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...
Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...
Importing namespace Cake.Common.Tools.TextTransform...
Importing namespace Cake.Common.Tools.VSTest...
Importing namespace Cake.Common.Tools.VSWhere...
Importing namespace Cake.Common.Tools.VSWhere.All...
Importing namespace Cake.Common.Tools.VSWhere.Latest...
Importing namespace Cake.Common.Tools.VSWhere.Legacy...
Importing namespace Cake.Common.Tools.VSWhere.Product...
Importing namespace Cake.Common.Tools.WiX...
Importing namespace Cake.Common.Tools.WiX.Heat...
Importing namespace Cake.Common.Tools.XBuild...
Importing namespace Cake.Common.Tools.XUnit...
Importing namespace Cake.Common.Xml...
Importing namespace Cake.Core...
Importing namespace Cake.Core.Diagnostics...
Importing namespace Cake.Core.IO...
Importing namespace Cake.Core.Scripting...
Importing namespace Cake.IIS...
Importing namespace Cake.IIS.Aliases...
Importing namespace Cake.Npm...
Importing namespace Cake.Npm.Ci...
Importing namespace Cake.Npm.Install...
Importing namespace Cake.Npm.Pack...
Importing namespace Cake.Npm.Publish...
Importing namespace Cake.Npm.Rebuild...
Importing namespace Cake.Npm.RunScript...
Importing namespace Cake.Npm.Set...
Importing namespace Cake.Npm.Update...
Importing namespace Cake.Npm.Version...
Importing namespace Cake.Powershell...
Importing namespace Cake.Services...
Importing namespace Microsoft.Web.Administration...
Importing namespace Newtonsoft.Json...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Management.Automation...
Importing namespace System.Reflection...
Importing namespace System.Security.Principal...
Importing namespace System.ServiceProcess...
Importing namespace System.Text...
Importing namespace System.Text.RegularExpressions...
Importing namespace System.Threading...
Importing namespace System.Threading.Tasks...
Compiling build script...
C:/Git/PowerDMS_Org/PowerDMS/utils/cake/build.cake(347,6): error CS1061: 'CakeTaskBuilder' does not contain a definition for 'Requires' and no extension method 'Requires' accepting a first argument of type 'CakeTaskBuilder' could be found (are you missing a using directive or an assembly reference?)
Error: Cake.Core.CakeException: Error(s) occurred when compiling build script:
C:/Git/PowerDMS_Org/PowerDMS/utils/cake/build.cake(347,6): error CS1061: 'CakeTaskBuilder' does not contain a definition for 'Requires' and no extension method 'Requires' accepting a first argument of type 'CakeTaskBuilder' could be found (are you missing a using directive or an assembly reference?)
   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()

Ahh wait, I used Requires instead of IsDependentOn. Wrong framework 🤦‍♂️

Works now 👍

@JamesFaix great! I’m going to go ahead and close this.

@ChrisMaddock @jnm2, regarding metapackages and #tool, feel free to open another issue to discuss it further. I think it would be a good idea to support, hence here’s the code in case anyone needs a PR for hacktoberfest :wink:

@ChrisMaddock Great, thanks for your help!

@JamesFaix Glad to hear it!

@mholo65 No problem: #2321.

Was this page helpful?
0 / 5 - 0 ratings