Code Monkey home page Code Monkey logo

resources's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

resources's Issues

build.sh doesn't pull modules correctly

The default place cake looks like modules is
Modules=./tools/Modules
and the place build.sh checks for a packages.conf file is
./tools/modules

One or the other will have to be changed to be compatible on linux (windows doesn't care about case)

Build.ps1 doesn't play nice with an existing 'tools' directory

If a tools directory already exists, then the current build.ps1 appears to want to delete all the contents. This is not very neighbourly of it (especially as it isn't that unusual for a solution to have a tools directory).

Ideally, build.ps1 should:

  1. warn if there's an existing tools directory and confirm with the user before splatting the contents
  2. respect the values configured in a cake.config file that optionally override what actual directory to use instead of the default 'tools'.

Fixing build.sh and argument parsing consistency

My PR #30 caused build.sh to stop accepting certain argument formattings that it used to accept. I thought cake.exe understood all these forms but it turns out it only understands --target=foo.

Current (breaks some people):

cake.exe build.ps1 build.sh
-t foo ✔️
-t=foo
-t:foo ✔️
-target foo ✔️
-target:foo ✔️
--target foo
--target=foo ✔️ ✔️ ✔️

What we need:

cake.exe build.ps1 build.sh
-t foo ✔️ ✔️
-t=foo
-t:foo ✔️
-target foo ✔️
-target:foo ✔️
--target foo ✔️
--target=foo ✔️ ✔️ ✔️

This is what we used to have. Not having --target Foo broke an NUnit build. The fix (--target=Foo) is easy and IMO preferable but I assume you don't want the break in the first place. Assuming you don't,

  • I need to get a bootstrapper fix in for this.

  • We need to have tests in this repo for this.


What would be cool:

After the immediate fix is taken care of, I propose changing cake.exe so that it understands at least -t foo, -t=foo, and --target foo in addition to --target=foo so that build.sh can go back to not having a special understanding of any arguments beyond --script:

cake.exe build.ps1 build.sh
-t foo ✔️ ✔️ ✔️
-t=foo ✔️ ✔️ ✔️
-t:foo ✔️
-target foo ✔️
-target:foo ✔️
--target foo ✔️ ✔️ ✔️
--target=foo ✔️ ✔️ ✔️

PowerShell bootstrapper fails when file on Path

I've discovered that the PowerShell bootstrapper fails when the $PATH environment variable contains a file, rather than a directory. That is, if it contains a file that happens to not be nuget.exe.

To reproduce: put any binary that isn't nuget.exe on the path, and run the bootstrapper. Ensure that nuget.exe is not present in the tools directory, to force the bootstrapper to find it.

When trying to find nuget.exe, it searches through the $PATH, and doesn't account for entries that may not be directories. It accepts any files it finds as being nuget.exe, then throws an error when it tries to execute it. This leaves your PowerShell session in the tools directory.

build.ps1: Imposible to pass an argument value with "," ";" symbols

I have a cake script with Argument publishTargets:

var publishTargets = Argument("publishTargets","dev,internal");

I need to pass a value like "dev,internal" or "dev,release" and so on into it.
The key point here is "," symbol. With ";" symbol there's the same picture.

What I tried:

1. via -arg

powershell ./build.ps1 -target Publish -publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true

Output:

D:\Work\R-n-D\XFW3.git\Build>D:\Work\R-n-D\XFW3.git\Build\build-Publish.cmd
At line:1 char:53
+ ./build.ps1 -target Publish -publishTargets=internal,dev -channel=SNA ...
+                                                     ~
Missing argument in parameter list.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingArgument

2. via ScriptArgs

powershell ./build.ps1 -target Publish -ScriptArgs '-publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true'

Output:

Running build script...
Invoke-Expression : At line:1 char:158
+ ... n="Release" -verbosity="Verbose"    -publishTargets=internal,dev -cha ...
+                                                                 ~
Missing argument in parameter list.
At D:\Work\R-n-D\XFW3.git\Build\build.ps1:188 char:1
+ Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : MissingArgument,Microsoft.PowerShell.Commands.InvokeExpressionCommand

3. via --arg

powershell ./build.ps1 -target Publish --publishTargets="internal,dev" -channel=SNAPSHOT --settings_skipverification=true

Output:

D:\Work\R-n-D\XFW3.git\Build>D:\Work\R-n-D\XFW3.git\Build\build-Publish.cmd
Preparing to run build script...
Running build script...
More than one build script specified.

Usage: Cake.exe [script] [--verbosity=value]
                [--showdescription] [--dryrun] [..]

Example: Cake.exe

4. Running directly via cake.exe

It works.

tools/Cake/cake -target=Publish -publishTargets="internal;dev" -channel=SNAPSHOT -settings_skipverification=true -verbosity=diagnostic

Environment

Cake 0.22.2
OS x64 Windows 10

Offline access

Is there any recommendations on how to utilise the bootstrapper on machines without internet access?

Our CI build agent machines cannot download anything directly but we can use proxy nuget and chocolatey sources, but the hard coded download paths in the bootstrapper script will not be allowed on our network so I'm looking for the bootstrapper to use one of those feeds instead.

How do you pass environment vars via build.ps1 to build.cake?

This evironment var seems to be ignored:

SET BUILD_VERSION=0.9.1-beta
powershell .\build.ps1 

My build.cake file has the following:

var version = Argument("build_version", "0.9.0-beta");

Task("Default")
.Does(() => {
    Information("version=" + version);
});

Allow script parameters to be overridden by environment vars

I have a customised build.ps1 that allows certain script parameters to be overridden by environment variables, this is particularly useful for the -Verbosity parameter.

[CmdletBinding()]
Param(
    [string]$Script = $(if (Test-Path env:/CAKE_SCRIPT) { "$env:CAKE_SCRIPT" } else { "build.cake" }),
    [string]$Target = $(if (Test-Path env:/CAKE_TARGET) { "$env:CAKE_TARGET" } else { "Default" }),
    [string]$Configuration = $(if (Test-Path env:/CONFIGURATION) { "$env:CONFIGURATION" } else { "Release" }),
    [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
    [string]$Verbosity = $(if (Test-Path env:/CAKE_VERBOSITY) { "$env:CAKE_VERBOSITY" } else { "Verbose" }),
    [switch]$Experimental,
    [Alias("DryRun","Noop")]
    [switch]$WhatIf,
    [switch]$Mono,
    [switch]$SkipToolPackageRestore,
    [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
    [string[]]$ScriptArgs
)

I am by no means a "powershell guy" but thought that this sort of alteration would be beneficial to others.

Environment Variable Naming

CAKE_SCRIPT, CAKE_TARGET and CAKE_VERBOSITY are named to prevent potential conflicts with other environment variables, while CONFIGURATION is specifically named this way as AppVeyor (maybe other CI servers) will set this to the build configuration.

Of course I have only done this for the powershell bootstrapper as we are building on Windows, I assume a similar approach can be done for the .sh script.

nuget doesn't download dependencies in the Addins folder

Start with tools\Addins\packages.config:

<packages>
    <package id="Moq" version="4.7.99" />
</packages>

run build.ps1.

The Castle.Core package isn't downloaded.

(We're actually using an internal package with a dependency. Moq is just an example package with a dependency)

Version number ignored in Addins\packages.config

Start with this packages.config file:

<packages>
    <package id="Microsoft.SqlServer.DacFx.x86" version="130.3485.1" />
</packages>

run build.ps1 and it'll download the package.

Update packages.config with the new version:

<packages>
    <package id="Microsoft.SqlServer.DacFx.x86" version="140.3745.1" />
</packages>

and run build.ps1.

The Addins folder incorrectly contains version 130.3485.1.

This scenario plays out when you commit the packages.config folder to source control, but not the packages themselves. When one developer updates packages.config, all the other developers continue to use the old version of the package.

build.cake file should be taken by default in $PSScriptRoot

Hi

I was expecting that the build.ps1 script would have taken the build.cake file from the same directory. I have a script (let's call it buildall.ps1 that searched for all build.ps1 scripts and invokes them.

The script is not working, because it tries to find the build.cake script inside the directory buildall.ps1. I can do a temporary pushd/popd, but I would propose to change the input parameter like this:

[string]$Script = (Join-Path $PSScriptRoot "build.cake")

Update cake.config to use nuget package source v3

The latest package source for nuget is now at v3. The cake.config resource should be updated to use v3.

[Nuget]
Source=https://packages.nuget.org/api/v2 <- v3

[Roslyn]
NuGetSource=https://packages.nuget.org/api/v2 <- v3

Feature Request: Add signature checks to build.ps1

Due to the environment of increased security requirements and recent incidents in npm world,
it would be advisable to add check the signatures of nuget.exe and nuget Cake (or Cake.exe) to build.ps1.

The signature of nuget.exe can be checked using the powershell command Get-AuthenticodeSignature
and nuget package Cake using nuget verify.

Full example of build.ps1 is on my gist https://gist.github.com/harrison314/4fc43f9e75016d6964fcdee3cde553fe.

Example snippet for check nuget.exe:

# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
    Write-Verbose -Message "Downloading NuGet.exe..."
    try {
        $wc = GetProxyEnabledWebClient
        $wc.DownloadFile($NUGET_URL, $NUGET_EXE)
    } catch {
        Throw "Could not download NuGet.exe."
    }

    $nugetSignature = Get-AuthenticodeSignature -FilePath $NUGET_EXE
    if ($nugetSignature.Status -ne "Valid") {
        Throw "Signature validation failed for NuGet.exe."
    }
}

Example snippet for check nuget.exe with explicit signature thumbprint:

$NUGET_EXE_SIGN_THUMBPRINTS = @("9DC17888B5CFAD98B3CB35C1994E96227F061675", "...another thumbprint...")

# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
    Write-Verbose -Message "Downloading NuGet.exe..."
    try {
        $wc = GetProxyEnabledWebClient
        $wc.DownloadFile($NUGET_URL, $NUGET_EXE)
    } catch {
        Throw "Could not download NuGet.exe."
    }

    $nugetSignature = Get-AuthenticodeSignature -FilePath $NUGET_EXE
    if ($nugetSignature.Status -ne "Valid" && $NUGET_EXE_SIGN_THUMBPRINTS.Contains($nugetSignature.SignerCertificate.Thumbprint)) {
        Throw "Signature validation failed for NuGet.exe."
    }
}

Example snippet for check Cake nuget:

Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""

if ($LASTEXITCODE -ne 0) {
    Throw "An error occurred while restoring NuGet tools."
}
else
{
    $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)

$cakePackage = Join-Path $TOOLS_DIR "Cake/Cake.nupkg"
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" verify Signatures `"$cakePackage`""
if ($LASTEXITCODE -ne 0) {
    Throw "Cake nuget is not signed."
}
Write-Verbose -Message ($NuGetOutput | out-string)

Bootstrapper and quoting of cakeArguments

The cake arguments like target do not include quotes currently.
For example it looks like;

if ($Target) { $cakeArguments += "-target=$Target" } 

In (very) old versions, it did quote the variables like:

-target=`"$Target`" 

Which allowed the target to contain for example spaces. Is there any reason that the quotes were removed?

MD5 Hash needs PowerShell 4

I went to try out the new MD5 additions to the PowerShell bootstrapper script and found out that it doesn't work on my machine (running PowerShell 3). It appears that Get-FileHash only works on PowerShell 4 and higher. Is it now expected to be on at least PowerShell 4 or are you still supporting lower versions as I see a commit right after the MD5 addition for PowerShell 2 support it looks.

PowerShell bootstrap script is not working when executing inside docker container

While executing Powershell bootstrap script inside docker container

Method invocation failed because [System.Reflection.Assembly] does not contain a method named 'LoadWithPartialName'.
At C:\dotnet\build.ps1:90 char:1

  • [Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-N ...
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound
    
    

Preparing to run build script...
Could not download packages.config.
At C:\dotnet\build.ps1:152 char:9

  •     Throw "Could not download packages.config."
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Could not download packages.config.:String) [], RuntimeException
    • FullyQualifiedErrorId : Could not download packages.config.

$PSVersionTable.PSVersion shows powershell version is 5

Major Minor Build Revision


5 1 14393 1000

Environment?
Windows 10

Dockerfile

FROM microsoft/aspnetcore-build
ADD . c:\dotnet

PowerShell bootstrap script not working with PS 6

@kentcb commented on Tue Dec 06 2016

What You Are Seeing?

When running the bootstrap script on PowerShell 6 (.NET core):

Method invocation failed because [System.Reflection.Assembly] does not contain a method named 'LoadWithPartialName'.
At C:\XXX\build.ps1:58 char:1
+ [Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-N ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

$PSVersionTable.PSVersion gives me:

Major Minor Patch Label
----- ----- ----- -----
    6     0     0 alpha

What is Expected?

Script should work with new versions of PS.

What version of Cake are you using?

Haven't gotten that far yet (bootstrapping).

Are you running on a 32 or 64 bit system?

64 bit.

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

Windows 10, but the same behavior should be present on other operating systems.

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

No

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

  1. Grab the bootstrap script
  2. Attempt to execute it in a PS 6 session

Output Log

N/A

TLS 1.2 for dotnet-install.ps1

@SharpeRAD commented on Fri Jul 27 2018

Just an FYI that I started to receive this exception on our build server this morning:

 (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUr ...  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException
The term 'C:\Tools\DotNet\dotnet-install.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I had a hunch it was due to TLS changes on the download server and appended this line to the powershell script which solved the issue:

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

Could be worth adding it to the default script as its a quick fix. Keep up the awesome work 🍰 team.

When passing a variable to build.cake that contains a space, the script throws an error

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

1.1.0

Operating system

macOS

Operating system architecture

64-Bit

CI Server

Azure Devops

What are you seeing?

When passing variable with a space, the logic parses the space and causes an error. "Any CPU" becomes Platform=Any CPU=???

What is expected?

variable: Platform = "Any CPU" should be passed as "Any CPU" to build.cake. This could be a powershell issue, but I believe it's a cake parsing issue.

Steps to Reproduce

Using the yml below, notice Platform has a space and when calling build.cake the parsing fails

yml:

  - master
  - development
  - dev
  - release/*
  - hotfix/*

pr:
  - master
  - development
  - release/*

variables:
  SYSTEM_ACCESSTOKEN: $(System.AccessToken)
  SolutionFile: "MyApp.sln"
  ZipProjects: "MyApp.iOS="
  StartUpProject: ""
  DomainProject: ""
  DomainOutputSql: ""
  DbContext: ""  
  BranchProject: "MyApp"
  Platform: "Any CPU"

pool:
  vmImage: 'macOS-latest'

stages:
- stage: BuildApp
  jobs:
  - job: myjob
    steps:
      - task: PowerShell@2
        displayName: 'PowerShell Script'
        inputs:
          targetType: filePath
          filePath: 'build/build_cake.ps1'
          arguments: '--Target=Deploy --Configuration=Store --Platform "$(Platform)" --ZipProjects "$(ZipProjects)" --SolutionFilePath "$(SolutionFile)" --StartUpProject "$(StartUpProject)" --DomainProject "$(DomainProject)" --DomainOutputSql "$(DomainOutputSql)" --DbContext "$(DbContext)" --BranchProject "$(BranchProject)"'
        env:
          SYSTEM_ACCESSTOKEN: $(System.AccessToken)
          NUGET_AUTH_TOKEN: $(NUGET_AUTH_TOKEN)```

### Output log

2021-05-05T16:45:12.7838560Z ##[debug]Evaluating condition for step: 'PowerShell Script'
2021-05-05T16:45:12.7840480Z ##[debug]Evaluating: SucceededNode()
2021-05-05T16:45:12.7841120Z ##[debug]Evaluating SucceededNode:
2021-05-05T16:45:12.7842160Z ##[debug]=> True
2021-05-05T16:45:12.7843380Z ##[debug]Result: True
2021-05-05T16:45:12.7844860Z ##[section]Starting: PowerShell Script
2021-05-05T16:45:12.7855390Z ==============================================================================
2021-05-05T16:45:12.7855770Z Task         : PowerShell
2021-05-05T16:45:12.7856610Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2021-05-05T16:45:12.7857190Z Version      : 2.180.1
2021-05-05T16:45:12.7857510Z Author       : Microsoft Corporation
2021-05-05T16:45:12.7857900Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2021-05-05T16:45:12.7858330Z ==============================================================================
2021-05-05T16:45:13.0075560Z ##[debug]Using node path: /Users/runner/runners/2.185.1/externals/node10/bin/node
2021-05-05T16:45:13.7711220Z ##[debug]agent.TempDirectory=/Users/runner/work/_temp
2021-05-05T16:45:13.7737530Z ##[debug]loading inputs and endpoints
2021-05-05T16:45:13.7747290Z ##[debug]loading INPUT_TARGETTYPE
2021-05-05T16:45:13.7769460Z ##[debug]loading INPUT_FILEPATH
2021-05-05T16:45:13.7772360Z ##[debug]loading INPUT_ARGUMENTS
2021-05-05T16:45:13.7774370Z ##[debug]loading INPUT_SCRIPT
2021-05-05T16:45:13.7776280Z ##[debug]loading INPUT_ERRORACTIONPREFERENCE
2021-05-05T16:45:13.7778210Z ##[debug]loading INPUT_FAILONSTDERR
2021-05-05T16:45:13.7780070Z ##[debug]loading INPUT_SHOWWARNINGS
2021-05-05T16:45:13.7781580Z ##[debug]loading INPUT_IGNORELASTEXITCODE
2021-05-05T16:45:13.7783370Z ##[debug]loading INPUT_PWSH
2021-05-05T16:45:13.7785320Z ##[debug]loading INPUT_WORKINGDIRECTORY
2021-05-05T16:45:13.7787180Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2021-05-05T16:45:13.7789040Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2021-05-05T16:45:13.7790570Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2021-05-05T16:45:13.7796270Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2021-05-05T16:45:13.7799550Z ##[debug]loading SECRET_NUGET_AUTH_TOKEN
2021-05-05T16:45:13.7801550Z ##[debug]loaded 15
2021-05-05T16:45:13.7807130Z ##[debug]Agent.ProxyUrl=undefined
2021-05-05T16:45:13.7808720Z ##[debug]Agent.CAInfo=undefined
2021-05-05T16:45:13.7809500Z ##[debug]Agent.ClientCert=undefined
2021-05-05T16:45:13.7810180Z ##[debug]Agent.SkipCertValidation=undefined
2021-05-05T16:45:13.7822070Z ##[debug]check path : /Users/runner/work/_tasks/PowerShell_e213ff0f-5d5c-4791-802d-52ea3e7be1f1/2.180.1/task.json
2021-05-05T16:45:13.7826410Z ##[debug]adding resource file: /Users/runner/work/_tasks/PowerShell_e213ff0f-5d5c-4791-802d-52ea3e7be1f1/2.180.1/task.json
2021-05-05T16:45:13.7827630Z ##[debug]system.culture=en-US
2021-05-05T16:45:13.7851230Z ##[debug]errorActionPreference=stop
2021-05-05T16:45:13.7854390Z ##[debug]showWarnings=false
2021-05-05T16:45:13.7855820Z ##[debug]failOnStderr=false
2021-05-05T16:45:13.7857370Z ##[debug]ignoreLASTEXITCODE=false
2021-05-05T16:45:13.7859660Z ##[debug]workingDirectory=/Users/runner/work/1/s
2021-05-05T16:45:13.7860450Z ##[debug]check path : /Users/runner/work/1/s
2021-05-05T16:45:13.7862020Z ##[debug]targetType=filePath
2021-05-05T16:45:13.7863480Z ##[debug]filePath=/Users/runner/work/1/s/build/build_cake.ps1
2021-05-05T16:45:13.7868930Z ##[debug]arguments=--Target=Deploy --Configuration=Store --Platform "Any CPU" --ZipProjects "iPartner.iOS=" --SolutionFilePath "MyApp.sln" --StartUpProject "" --DomainProject "" --DomainOutputSql "" --DbContext "" --BranchProject "MyApp"
2021-05-05T16:45:13.7882470Z Generating script.
2021-05-05T16:45:13.7917350Z ##[debug]Processed: ##vso[task.logdetail id=1f487e06-e8ff-40ad-99c8-485cbcbe2e14;type=command;name=command;]Formatted command: . '/Users/runner/work/1/s/build/build_cake.ps1' --Target=Deploy --Configuration=Store --Platform "Any CPU" --ZipProjects "MyApp.iOS=" --SolutionFilePath "MyApp.sln" --StartUpProject "" --DomainProject "" --DomainOutputSql "" --DbContext "" --BranchProject "MyApp"
2021-05-05T16:45:13.7919620Z ##[debug]Agent.Version=2.185.1
2021-05-05T16:45:13.7920360Z ##[debug]agent.tempDirectory=/Users/runner/work/_temp
2021-05-05T16:45:13.7921510Z ##[debug]check path : /Users/runner/work/_temp
2021-05-05T16:45:13.7922110Z ========================== Starting Command Output ===========================
2021-05-05T16:45:13.7923110Z ##[debug]which 'pwsh'
2021-05-05T16:45:13.7924080Z ##[debug]found: '/usr/local/bin/pwsh'
2021-05-05T16:45:13.7925050Z ##[debug]which '/usr/local/bin/pwsh'
2021-05-05T16:45:13.7925950Z ##[debug]found: '/usr/local/bin/pwsh'
2021-05-05T16:45:13.7926920Z ##[debug]/usr/local/bin/pwsh arg: -NoLogo
2021-05-05T16:45:13.7927910Z ##[debug]/usr/local/bin/pwsh arg: -NoProfile
2021-05-05T16:45:13.7928900Z ##[debug]/usr/local/bin/pwsh arg: -NonInteractive
2021-05-05T16:45:13.7929830Z ##[debug]/usr/local/bin/pwsh arg: -Command
2021-05-05T16:45:13.7930940Z ##[debug]/usr/local/bin/pwsh arg: . '/Users/runner/work/_temp/83b58027-96e2-405d-a94e-f18f12fa0d46.ps1'
2021-05-05T16:45:13.7931840Z ##[debug]exec tool: /usr/local/bin/pwsh
2021-05-05T16:45:13.7932520Z ##[debug]arguments:
2021-05-05T16:45:13.7933390Z ##[debug]   -NoLogo
2021-05-05T16:45:13.7934240Z ##[debug]   -NoProfile
2021-05-05T16:45:13.7935150Z ##[debug]   -NonInteractive
2021-05-05T16:45:13.7936040Z ##[debug]   -Command
2021-05-05T16:45:13.7937040Z ##[debug]   . '/Users/runner/work/_temp/83b58027-96e2-405d-a94e-f18f12fa0d46.ps1'
2021-05-05T16:45:13.7938270Z [command]/usr/local/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/Users/runner/work/_temp/83b58027-96e2-405d-a94e-f18f12fa0d46.ps1'
2021-05-05T16:45:15.3878690Z Preparing to run build script...
2021-05-05T16:45:15.4604020Z Tools: /Users/runner/work/1/s/build/tools
2021-05-05T16:45:15.4611460Z Tools: /Users/runner/work/1/s/build/tools/Addins
2021-05-05T16:45:21.8034060Z Start testing Cake path.
2021-05-05T16:45:21.8085380Z Running build script...
2021-05-05T16:45:22.7154760Z 
2021-05-05T16:45:22.7158560Z Error: Unknown command 'CPU'.
2021-05-05T16:45:22.7159770Z 
2021-05-05T16:45:22.7161940Z        .\build\build.cake --verbosity=Diagnostic --Target=Deploy 
2021-05-05T16:45:22.7164770Z --Configuration=Store --Platform Any CPU --ZipProjects MyApp.iOS= 
2021-05-05T16:45:22.7167780Z --SolutionFilePath MyApp.sln --StartUpProject --DomainProject 
2021-05-05T16:45:22.7169780Z --DomainOutputSql --DbContext --BranchProject MyApp
2021-05-05T16:45:22.7171170Z                                                                                 
2021-05-05T16:45:22.7172480Z ^^^ No such command
2021-05-05T16:45:22.7173260Z 
2021-05-05T16:45:22.7234780Z ##[debug]$LASTEXITCODE: 255
2021-05-05T16:45:22.7476860Z ##[debug]Exit code 1 received from tool '/usr/local/bin/pwsh'
2021-05-05T16:45:22.7482740Z ##[debug]STDIO streams have closed for tool '/usr/local/bin/pwsh'
2021-05-05T16:45:22.7497960Z ##[debug]task result: Failed
2021-05-05T16:45:22.7530120Z ##[error]PowerShell exited with code '1'.
2021-05-05T16:45:22.7542400Z ##[debug]Processed: ##vso[task.issue type=error;]PowerShell exited with code '1'.
2021-05-05T16:45:22.7553090Z ##[debug]Processed: ##vso[task.complete result=Failed;]PowerShell exited with code '1'.
2021-05-05T16:45:22.7564290Z ##[section]Finishing: PowerShell Script

How do you pass parameters to build.cake from build.ps1?

My build.cake file has this:

var version = Argument("build_version", "0.9.0-beta");

I'm trying to pass the information to build.ps1:

powershell .\build.ps1 -build_version=%VERSION%

This doesn't seem to work. The documentation talks about cake.exe, but that's some internal exe that I don't use directly, right? (Why does the documentation even talk about cake.exe? http://cakebuild.net/docs/fundamentals/configuration)

Is there confusion internally what we should be using, cake.exe vs build.ps1?

-ScriptArgs not working with "=" in other arguments

I am using the following arguments in PowerShell with the bootstrapper:
.\build.ps1 -target=build -configuration=Debug -ScriptArgs='--packageVersion="1.0.0-dev"'

What You Are Seeing?

packageVersion is staying set to the default value, "1.0.0".

What is Expected?

packageVersion = "1.0.0-dev"

When I remove '=' from arguments, I get the expected results:
.\build.ps1 -target build -configuration Debug -ScriptArgs '--packageVersion="1.0.0-dev"'

What version of Cake are you using?

v0.32.1

Are you running on a 32 or 64 bit system?

64-bit

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

Windows 10

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

TeamCity

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

Output Log

Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing C:/bitbucket/redacted/redacted-grpc/build.cake...
Processing build script...
Installing tools...
Found package 'NUnit.ConsoleRunner 3.4.0' in 'C:/bitbucket/redacted/redacted-grpc/tools'.
Package NUnit.ConsoleRunner.3.4.0 has already been installed.
Successfully installed 'NUnit.ConsoleRunner 3.4.0' to C:/bitbucket/redacted/redacted-grpc/tools
Executing nuget actions took 42.56 ms
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...
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.BuildServer...
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.Label...
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 System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
Compiling build script...
My target = build
My configuration = Debug
My packageVersion = 1.0.0

========================================
Clean

Executing task: Clean
Cleaning directory C:/bitbucket/redacted/redacted-grpc/src/redactedGrpc/bin/Debug
Cleaning directory C:/bitbucket/redacted/redacted-grpc/nuget
Finished executing task: Clean

========================================
Restore-NuGet-Packages

Executing task: Restore-NuGet-Packages
Executing: "C:/bitbucket/redacted/redacted-grpc/tools/NuGet.exe" restore "C:/bitbucket/redacted/redacted-grpc/src/redacted.redacted.redactedGrpc.sln" -NonInteractive
MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
All packages listed in packages.config are already installed.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\obj\project.assets.json
Restore completed in 67.15 ms for C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj.

NuGet Config files used:
C:\Users\CarteriTrellis\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config

Feeds used:
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages
https://api.nuget.org/v3/index.json
https://artifactory.redacted.com/artifactory/api/nuget/redacted
Finished executing task: Restore-NuGet-Packages

========================================
Build

Executing task: Build
Executing: "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/amd64/MSBuild.exe" /v:normal /p:Configuration="Debug" /target:Build "C:/bitbucket/redacted/redacted-grpc/src/redacted.redacted.redactedGrpc.sln"
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 4/17/2019 2:22:06 PM.
Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" on node 1 (Build target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" (1) is building "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj" (2) on node 1 (default targets).
_HandlePackageFileConflicts:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Google.Protobuf, Version=3.7.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL' and 'Reference:C:\Users\CarteriTrellis.nuget\packages\google.protobuf\3.7.0\lib\net45\Google.Protobuf.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL' and 'Reference:C:\Users\CarteriTrellis.nuget\packages\grpc.core\1.19.0\lib\net45\Grpc.Core.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Grpc.Core.Api, Version=0.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL' and 'Reference:C:\Users\CarteriTrellis.nuget\packages\grpc.core.api\1.19.0\lib\net45\Grpc.Core.Api.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.Interactive.Async, Version=3.2.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL' and 'Reference:C:\Users\CarteriTrellis.nuget\packages\system.interactive.async\3.2.0\lib\net46\System.Interactive.Async.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Google.Protobuf, Version=3.7.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL' and 'CopyLocal:C:\Users\CarteriTrellis.nuget\packages\google.protobuf\3.7.0\lib\net45\Google.Protobuf.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL' and 'CopyLocal:C:\Users\CarteriTrellis.nuget\packages\grpc.core\1.19.0\lib\net45\Grpc.Core.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:Grpc.Core.Api, Version=0.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL' and 'CopyLocal:C:\Users\CarteriTrellis.nuget\packages\grpc.core.api\1.19.0\lib\net45\Grpc.Core.Api.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.ConflictResolution.targets(33,5): message NETSDK1041: Encountered conflict between 'Reference:System.Interactive.Async, Version=3.2.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL' and 'CopyLocal:C:\Users\CarteriTrellis.nuget\packages\system.interactive.async\3.2.0\lib\net46\System.Interactive.Async.dll'. NETSDK1037: Could not determine winner due to equal file and assembly versions. [C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj]
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
_Protobuf_GatherStaleBatched:
Skipping target "_Protobuf_GatherStaleBatched" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyFilesMarkedCopyLocal:
Copying file from "C:\Users\CarteriTrellis.nuget\packages\grpc.core\1.19.0\lib\net45\Grpc.Core.dll" to "bin\Debug\Grpc.Core.dll".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\grpc.core\1.19.0\runtimes\win\native\grpc_csharp_ext.x64.dll" to "bin\Debug\grpc_csharp_ext.x64.dll".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\grpc.core\1.19.0\runtimes\win\native\grpc_csharp_ext.x86.dll" to "bin\Debug\grpc_csharp_ext.x86.dll".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\google.protobuf\3.7.0\lib\net45\Google.Protobuf.dll" to "bin\Debug\Google.Protobuf.dll".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\grpc.core\1.19.0\lib\net45\Grpc.Core.pdb" to "bin\Debug\Grpc.Core.pdb".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\google.protobuf\3.7.0\lib\net45\Google.Protobuf.pdb" to "bin\Debug\Google.Protobuf.pdb".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\grpc.core.api\1.19.0\lib\net45\Grpc.Core.Api.dll" to "bin\Debug\Grpc.Core.Api.dll".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\grpc.core.api\1.19.0\lib\net45\Grpc.Core.Api.pdb" to "bin\Debug\Grpc.Core.Api.pdb".
Copying file from "C:\Users\CarteriTrellis.nuget\packages\system.interactive.async\3.2.0\lib\net46\System.Interactive.Async.dll" to "bin\Debug\System.Interactive.Async.dll".
Touching "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\obj\Debug\redacted.redacted.redactedGrpc.csproj.CopyComplete".
_CopyOutOfDateSourceItemsToOutputDirectory:
Building target "_CopyOutOfDateSourceItemsToOutputDirectory" partially, because some output files are out of date with respect to their input files.
Copying file from "C:\bitbucket\redacted\redacted-grpc\src\packages\Grpc.Core.1.19.0\runtimes\osx\native\libgrpc_csharp_ext.x64.dylib" to "bin\Debug\libgrpc_csharp_ext.x64.dylib".
Copying file from "C:\bitbucket\redacted\redacted-grpc\src\packages\Grpc.Core.1.19.0\runtimes\linux\native\libgrpc_csharp_ext.x64.so" to "bin\Debug\libgrpc_csharp_ext.x64.so".
Copying file from "C:\bitbucket\redacted\redacted-grpc\src\packages\Grpc.Core.1.19.0\runtimes\osx\native\libgrpc_csharp_ext.x86.dylib" to "bin\Debug\libgrpc_csharp_ext.x86.dylib".
Copying file from "C:\bitbucket\redacted\redacted-grpc\src\packages\Grpc.Core.1.19.0\runtimes\linux\native\libgrpc_csharp_ext.x86.so" to "bin\Debug\libgrpc_csharp_ext.x86.so".
CopyFilesToOutputDirectory:
Copying file from "obj\Debug\redacted.redacted.redactedGrpc.dll" to "bin\Debug\redacted.redacted.redactedGrpc.dll".
redacted.redacted.redactedGrpc -> C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\bin\Debug\redacted.redacted.redactedGrpc.dll
Copying file from "obj\Debug\redacted.redacted.redactedGrpc.pdb" to "bin\Debug\redacted.redacted.redactedGrpc.pdb".
Done Building Project "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\redacted.redacted.redactedGrpc.csproj" (default targets).
Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" (1) is building "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServer\redacted.redacted.redactedGrpcServer.csproj" (3) on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyFilesMarkedCopyLocal:
Touching "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServer\obj\Debug\redacted.redacted.redactedGrpcServer.csproj.CopyComplete".
_CopyOutOfDateSourceItemsToOutputDirectory:
Skipping target "_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
redacted.redacted.redactedGrpcServer -> C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServer\bin\Debug\redacted.redacted.redactedGrpcServer.dll
Done Building Project "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServer\redacted.redacted.redactedGrpcServer.csproj" (default targets).
Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" (1) is building "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerConsole\redacted.redacted.redactedGrpcServer.Console.csproj" (4) on node 1 (default targets).
GenerateBindingRedirects:
No suggested binding redirects from ResolveAssemblyReferences.
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyFilesMarkedCopyLocal:
Touching "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerConsole\obj\Debug\redacted.redacted.redactedGrpcServer.Console.csproj.CopyComplete".
_CopyOutOfDateSourceItemsToOutputDirectory:
Skipping target "_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
_CopyAppConfigFile:
Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
redacted.redacted.redactedGrpcServer.Console -> C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerConsole\bin\Debug\redacted.redacted.redactedGrpcServer.Console.exe
Done Building Project "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerConsole\redacted.redacted.redactedGrpcServer.Console.csproj" (default targets).
Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" (1) is building "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcClientConsole\redacted.redacted.redactedGrpcClient.Console.csproj" (5) on node 1 (default targets).
GenerateBindingRedirects:
No suggested binding redirects from ResolveAssemblyReferences.
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
_CopyFilesMarkedCopyLocal:
Touching "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcClientConsole\obj\Debug\redacted.redacted.redactedGrpcClient.Console.csproj.CopyComplete".
_CopyOutOfDateSourceItemsToOutputDirectory:
Skipping target "_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
_CopyAppConfigFile:
Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
redacted.redacted.redactedGrpcClient.Console -> C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcClientConsole\bin\Debug\redacted.redacted.redactedGrpcClient.Console.exe
Done Building Project "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcClientConsole\redacted.redacted.redactedGrpcClient.Console.csproj" (default targets).
Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" (1) is building "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerTests\redacted.redacted.redactedGrpcServer.Tests.csproj" (6) on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
redacted.redacted.redactedGrpcServer.Tests -> C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerTests\bin\Debug\redacted.redacted.redactedGrpcServer.Tests.dll
Done Building Project "C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServerTests\redacted.redacted.redactedGrpcServer.Tests.csproj" (default targets).
Done Building Project "C:\bitbucket\redacted\redacted-grpc\src\redacted.redacted.redactedGrpc.sln" (Build target(s)).

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:01.06
Executing: "C:/bitbucket/redacted/redacted-grpc/tools/NuGet.exe" pack -OutputDirectory "C:/bitbucket/redacted/redacted-grpc/nuget" "C:/bitbucket/redacted/redacted-grpc/src/redactedGrpc/redacted.redacted.redactedGrpc.csproj" -IncludeReferencedProjects -Properties "Version=1.0.0;Configuration=Debug;Description=redactedGrpc Artifact" -Exclude *.x64.*;*.x86.*
Attempting to build package from 'redacted.redacted.redactedGrpc.csproj'.
MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
Packing files from 'C:\bitbucket\redacted\redacted-grpc\src\redactedGrpc\bin\Debug'.
Using 'redacted.redacted.redactedGrpc.nuspec' for metadata.
Found packages.config. Using packages listed as dependencies
Successfully created package 'C:\bitbucket\redacted\redacted-grpc\nuget\redacted.redacted.redactedGrpc.1.0.0.nupkg'.
Executing: "C:/bitbucket/redacted/redacted-grpc/tools/NuGet.exe" pack -OutputDirectory "C:/bitbucket/redacted/redacted-grpc/nuget" "C:/bitbucket/redacted/redacted-grpc/src/redactedGrpcServer/redacted.redacted.redactedGrpcServer.csproj" -IncludeReferencedProjects -Properties "Version=1.0.0;Configuration=Debug;Description=redactedGrpcServer Artifact" -Exclude *.x64.*;*.x86.*
Attempting to build package from 'redacted.redacted.redactedGrpcServer.csproj'.
MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
Packing files from 'C:\bitbucket\redacted\redacted-grpc\src\redactedGrpcServer\bin\Debug'.
Using 'redacted.redacted.redactedGrpcServer.nuspec' for metadata.
Found packages.config. Using packages listed as dependencies
Successfully created package 'C:\bitbucket\redacted\redacted-grpc\nuget\redacted.redacted.redactedGrpcServer.1.0.0.nupkg'.
Finished executing task: Build

Task Duration

Clean 00:00:00.0209161
Restore-NuGet-Packages 00:00:01.7008201
Build 00:00:05.3842408

Total: 00:00:07.1059770

Building from VS Code extension fails when inside directory with spaces in name

Create a directory like "C:\Directory with spaces".
Download build.ps1 and sample build.cake.
From within VS Code (with Cake extension) click the "run task" over Task("Default").

This executes:
Powershell -ExecutionPolicy ByPass -File build.ps1 -script "c:\Directory with spaces\build.cake" -target "Default" -verbosity normal

In build.ps1 the quotes surrounding script parameter are lost, leading to:
"More than one build script specified."

Cake bootstrapper should honor cake.config tools path (build.ps1, build.sh)

What You Are Seeing?

build.ps1 and build.sh do not honor the Tools path defined in cake.config. The path for tools, add-ins, modules, etc. is hard-coded in the boostrapper.

What is Expected?

Before downloading Cake, build.ps1 and build.sh should read the tools path defined in cake.config and use that path to store the Cake tool before downloading.

What version of Cake are you using?

0.38.2

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

  • Download cake.config from the resources repo
  • Download build.ps1 or build.sh from the resources repo
  • Modify the tools path of cake.config to something else other than ./tools. E.g. ./build/tools
; This is the default configuration file for Cake.
; This file was downloaded from https://github.com/cake-build/resources

[Nuget]
Source=https://api.nuget.org/v3/index.json
UseInProcessClient=true
LoadDependencies=false

[Paths]
-Tools=./tools
+Tools=./build/tools
-Addins=./tools/Addins
+Addins=./build/tools/Addins
-Modules=./tools/Modules
+Modules=./build/tools/Modules

[Settings]
SkipVerification=false
  • Run build.ps1 or build.sh and notice that the Cake tools were downloaded to ./tools instead of ./build/tools as specified in cake.config

image

NuGet 4.4.0 Error Code 1 Packages Already Installed

@thnk2wn commented on Tue Oct 24 2017

What You Are Seeing?

Having nuget.exe 4.4.0 in Cake/Tools with packages already installed results in error code 1 "all packages are already installed". This causes build.ps1 to fail early restoring tools/addins and stops the build process. Generally this isn't a problem on the build server with fresh downloads and builds but it happens regularly for local builds. Perhaps LASTEXITCODE changes with NuGet 4.4.0. This version of NuGet was needed for some .NET Standard 2.0 issues.

What is Expected?

Expecting Cake's build.ps1 to detect such "error" (warning at best?) and to proceed regardless of whether packages are already installed.

What version of Cake are you using?

0.23.0

Are you running on a 32 or 64 bit system?

64

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

Windows 10 Fall Creators Update.

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

Both CI and local. CI is TeamCity 9.x.

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

Download NuGet 4.4.0 from https://www.nuget.org/downloads (it appears to be preview currently).
Place this download in Cake/tools.
Invoke the build once via build.ps1, all is fine.
Invoke the build a 2nd time with the packages already installed.
Receive "error" 1 that packages are already installed.

Some more context in this post:
https://geoffhudik.com/tech/2017/10/24/build-blues-with-net-standard-2-0/

Output Log

C:\source\projectname\cake [feature/Win10FallCreatorsUpdate ≡]> .\build.ps1 -Verbosity diagnostic
Preparing to run build script...
Feeds used:
  C:\Users\geoffh\.nuget\packages\
  https://api.nuget.org/v3/index.json
  https://www.myget.org/F/msbuildsdkextras/api/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

An error occured while restoring NuGet tools.
At C:\source\projectname\cake\build.ps1:173 char:9
+         Throw "An error occured while restoring NuGet tools."
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (An error occure...ng NuGet tools.:String) [], RuntimeException
    + FullyQualifiedErrorId : An error occured while restoring NuGet tools.

Possible Issues Here

  1. Cake should perhaps treat exit code 1 with "packages already installed" as not an error that stops the script. Perhaps this behavior changed with Nuget 4.4.0.

  2. The error message indicates neither the exit code nor the nuget output so it says nothing useful to help the situation.

  3. The word "occured" is misspelled - should be "occurred".

  4. When an error happens here, Pop-Location isn't executed so it leaves things at a different location than where things were when the script started, leading to possible issues later.

  5. Ideally there'd be a way to specify the NuGet version (like when referencing Nuget package tools/addins) of NuGet.exe itself instead of having to place a version here and commit to source control. I don't think the Cake build script could even download NuGet as it would have to happen before #tool or #addin and I think those have to be first.

Workaround Changes Made (build.ps1)

if(-Not $SkipToolPackageRestore.IsPresent) {
    Push-Location
    Set-Location $TOOLS_DIR

    # Check for changes in packages.config and remove installed tools if true.
    [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
    if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
      ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
        Write-Verbose -Message "Missing or changed package.config hash..."
        Remove-Item * -Recurse -Exclude packages.config,nuget.exe
    }

    Write-Verbose -Message "Restoring tools from NuGet..."
    $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""

    if ($LASTEXITCODE -ne 0) {
        Write-Warning ($NuGetOutput | out-string)

        if ($LASTEXITCODE -eq 1 -and $NuGetOutput -match ' are already installed') {
            Write-Verbose -Message 'Packages already installed, continuing.'
        }
        else {
            Pop-Location
            throw ("NuGet returned error {0} restoring NuGet tools." -f $LASTEXITCODE)
        }
    }
    else
    {
        $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
        Write-Verbose -Message ($NuGetOutput | out-string)
    }
    
    Pop-Location
}

@ahoefling commented on Sat Nov 04 2017

I did some investigation on this and I came to the same conclusion, it appears that Cake is using NuGet version 4.3 and there have been changes to NuGet 4.4 that directly apply to the latest windows fall creators update and netstandard builds. If I run the command nuget restore project.sln with NuGet 4.3 I get errors but if I run the same command with NuGet 4.4 the restore runs without issue.

Environment

Name Version
Windows 10 Fall Creators Update 16299
Xamarin.Forms 2.4.018342
UWP 10.0.16299
Cake 0.23.0

Errors
This error is displayed in the build log and as @thnk2wn mentioned in the shared link it is a problem with NuGet 4.3 which I also reproduced by running the following command

  • nuget restore project.sln
Errors in C:\source\TabStrip\CarouselView\CarouselView.FormsPlugin.UWP\CarouselView.FormsPlugin.UWP.csproj
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299). Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-arm. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-arm-aot. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x64. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x64-aot. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x86. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x86-aot. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
Errors in C:\source\TabStrip\src\TabStrip.FormsPlugin.UWP\TabStrip.FormsPlugin.UWP.csproj
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299). Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-arm. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-arm-aot. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x64. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x64-aot. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x86. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)
    NU1201: Project CarouselView.FormsPlugin.Abstractions is not compatible with uap10.0.16299 (UAP,Version=v10.0.16299) / win10-x86-aot. Project CarouselView.FormsPlugin.Abstractions supports: netstandard2.0 (.NETStandard,Version=v2.0)

Attempted Solution
I first attempted cloning the repository to see how hard it would be to update the cake to use netstandard 2.0 and quickly learned there are a lot of dependencies and it will require more than an hour of time.

Work Around
I tried updating the powershell script with the provided script above and that did not work because the nuget restore referenced from cake is still using NuGet 4.3. I ended up making modifications to the powershell script to use the following logic:

  1. Check if nuget is a version < 4.4
  2. if true download version 4.4
  3. prior to running the cake build execute nuget restore project.sln
  4. execute cake build

I understand this is a hard coded hack but it solves my problem for now and hopefully this is a suitable workaround for others that run into this problem while we wait for an updated version.

Powershell Updates
Variables:

$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins"
$MODULES_DIR = Join-Path $TOOLS_DIR "Modules"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"

Note the download path for nuget is changed

Nuget:

# Try download NuGet.exe if not exists
if(!(Test-Path $NUGET_EXE))
{
	Write-Verbose -Message "Downloading NuGet.exe..."
    try {
        $wc = GetProxyEnabledWebClient
        $wc.DownloadFile($NUGET_URL, $NUGET_EXE)
    } catch {
        Throw "Could not download NuGet.exe."
    }
}
else
{
	# Check if the current version of nuget is 4.4 if not download it
	$version = (nuget.exe | Select-Object -First 1).Split(':')[1].Trim()
	if(!($version.StartsWith("4.4")))
	{
		Write-Verbose -Message "Downloading NuGet.exe..."
		try {
			$wc = GetProxyEnabledWebClient
			$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
		} catch {
			Throw "Could not download NuGet.exe."
		}
	}
}

then at the bottom of the build.ps1 script should look like this to force a nuget restore

Execute NuGet restore and Cake Build

# run nuget command
nuget restore Project.sln

# Start Cake
Write-Host "Running build script..."
&$CAKE_EXE $cakeArguments
exit $LASTEXITCODE

Just to reiterate - my solution is intended to get my projects by until cake supports NuGet 4.4, I understand it is not the most elegant way to solve this problem. If you choose to use the updates provided there may be side effects with your project.


@gep13 commented on Sat Nov 04 2017

@thnk2wn @ahoefling since these issues seems to be related to the bootstrapper that is provided with Cake, I am going to close this issue out, and move it to the resources repo, which is where the bootstrapper lives.

Add build.sh version for Windows

Cake is an excellent tool, and the "Getting Started" guide and this repo really helps to get started. I just installed it in my toy project, and was really easy 👍

However, the build.sh script seems only to be working on linux/osx, and not on Windows, since the build.ps1 is for that. However, with bash becoming more popular on Windows, and having that easily available with Git for Windows, people are starting to use that as a default shell more often. It would be nice if this repo would provide a canonical version for Windows of build.sh, or adjust the current one so it also works on Windows.

Could this be added, or do you accept a PR for that?

CI builds are not failing like they ought to when build steps are failing

Currently the latest travis build contains:

$ pwsh -command "Invoke-Expression .\tests\Tests.ps1"
New-Item: /home/travis/build/cake-build/resources/tests/Tests.ps1:6
Line |
   6 |      New-Item -Type Directory -Path $testresultFolder -Force
     |                                     ~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Path' because it is an
     | empty string.

Execute tests for build.ps1 in powershell
Join-Path: /home/travis/build/cake-build/resources/tests/Tests.ps1:11
Line |
  11 |  … ormat NUnitXml -OutputFile (Join-Path -Path $testresultFolder -ChildP …
     |                                                ~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Path' because it is an
     | empty string.

The command "pwsh -command "Invoke-Expression .\tests\Tests.ps1"" exited with 0.

So even though something fails in the script it does return a non-zero result code. In the unix world this is solved by simply adding a set -e to make the script exit on first error with an error code. With powershell there is no similar simple solution.

For internal errors, like the "cannot bind ..." error above, there is something that sort of resembles set -e but without the elegance:

# From https://stackoverflow.com/a/44810914/23118
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
function ThrowOnNativeFailure {
    if (-not $?) {
        throw 'Native Failure'
    }
}

although that is not complete, in order to catch errors from external commands you have to painstakingly make sure that every single external command invocation is wrapped through an exec function:

# Getting powershell to exit whenever some of the commands fail is by far not as
# straight forward as "set -e" is in bash. Further info:
# https://stackoverflow.com/questions/11450153/powershell-analogue-of-bashs-set-e
# https://stackoverflow.com/questions/10666101/lastexitcode-0-but-false-in-powershell-redirecting-stderr-to-stdout-gives
# https://stackoverflow.com/questions/9948517/how-to-stop-a-powershell-script-on-the-first-error
# https://rkeithhill.wordpress.com/2009/08/03/effective-powershell-item-16-dealing-with-errors/
# https://github.com/PowerShell/PowerShell-RFC/pull/261/files
#
# TL;DR: wrap all external commands inside the exec function, e.g.
#    exec { docker build -t mytag . }

# From https://stackoverflow.com/a/48999101/23118
#
# Taken from psake https://github.com/psake/psake (MIT License)
<#
.SYNOPSIS
  This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
  to see if an error occcured. If an error is detected then an exception is thrown.
  This function allows you to run command-line programs without having to
  explicitly check the $lastexitcode variable.
.EXAMPLE
  exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
#>
function Exec {
    [CmdletBinding()]
    param(
        [Parameter(Position = 0, Mandatory = 1)][scriptblock]$cmd,
        [Parameter(Position = 1, Mandatory = 0)][string]$errorMessage = ("Error executing command {0}" -f $cmd)
    )
    & $cmd
    if ($lastexitcode -ne 0) {
        throw ("Exec: " + $errorMessage)
    }
}

Similarly, the appveyor builds have green status even though everything currently is failing:

Image: Visual Studio 2017                          4 of 4 failed
Image: Ubuntu                                      2 of 2 failed

They are failing due to build.ps1 missing, so copy from dotnet-framework like I did for the travis build, although fixing that is the minor issue here.

The major issue is that the build scripts should fail when anything goes wrong.

PS I am only reporting this, I do not intend to work on fixing this.

Simplify Bootstrappers

The current default bootstrappers (i.e. the ones in this repository, prior to personal modifications) do a number of things, these include:

  • Makes sure that the tools folder exists
  • Makes sure that the packages.config exists (if it doesn't, the default packages.config file is downloaded from this repository)
  • Checks to see if NuGet.exe is present, if not, download it
  • Check to see if packages.config file has changed since last build execution, if it has, delete contents of tools folder
  • Restore tools from packages.config file
  • Update packages.config file hash
  • If there is a addins/packages.config file, restore addins
  • If there is a modules/packages.config file, restore modules
  • Test to see if cake.exe is present in tools folder, if not, throw error
  • Prepare Cake Arguments, and invoke Cake.exe

TLS Issue: build.ps1 - Could not download packages.config

I have recently seen builds fail on Windows Server 2012 R2 build 9600 with the following:

D:\Jenkins\workspace\project-MFC7ZSI6BD4TDSTZ3QZN42CB6N4YSMKVGVEKCGPUBF3L2K2AFZCA>powershell .\build.ps1 
Preparing to run build script...
Could not download packages.config.
At D:\Jenkins\workspace\project-MFC7ZSI6BD4TDSTZ3QZN42CB6N4
YSMKVGVEKCGPUBF3L2K2AFZCA\build.ps1:126 char:9
+         Throw "Could not download packages.config."
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not download packages.c 
   onfig.:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not download packages.config.

This is due to the an issue with TLS during redirect from https://cakebuild.net/download/bootstrapper/packages to https://raw.githubusercontent.com/cake-build/resources/master/packages.config

Unwrapping the WebClient call results in the following exception:

Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."

Parameters to bootstrap with "." not supported

@ravensorb commented on Fri Jul 15 2016

What You Are Seeing?

Calling build.ps with a parameter that contains a "." is failing

Ex: .\build.ps1 -Target UnPublish -skipBuild=1 -versionToDelete="2.3.0-pre01"

Error:
Preparing to run build script...
Running build script...
More than one build script specified.

What is Expected?

Parameter is passed to cake script

What version of Cake are you using?

0.13.0

Are you running on a 32 or 64 bit system?

64

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

Windows

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

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

Run the following command

  • .\build.ps1 -Target UnPublish -skipBuild=1 -versionToDelete="2.3.0-pre01"

Output Log

PS E:\Project> .\build.ps1 -Target UnPublish -skipBuild=1 -versionToDelete="2.3.0-pre01" -verbosity Diagnostic -debug
Preparing to run build script...
Running build script...
More than one build script specified.
Module directory does not exist.

Usage: Cake.exe [build-script] [-verbosity=value]
[-showdescription] [-dryrun] [..]

Example: Cake.exe
Example: Cake.exe build.cake -verbosity=quiet
Example: Cake.exe build.cake -showdescription

Options:
-verbosity=value Specifies the amount of information to be displayed.
(Quiet, Minimal, Normal, Verbose, Diagnostic)
-debug Performs a debug.
-showdescription Shows description about tasks.
-dryrun Performs a dry run.
-version Displays version information.
-help Displays usage information.
-mono Uses the Mono Compiler, rather than Roslyn script engine.
-experimental Uses the nightly builds of Roslyn script engine.


@devlead commented on Fri Jul 15 2016

Does it work if you change to
.\build.ps1 -Target UnPublish -Script .\build.cake -verbosity Diagnostic '-skipBuild=1 -versionToDelete="2.3.0-pre01" -debug'


@ravensorb commented on Fri Jul 15 2016

Yes that does seem to work


@devlead commented on Fri Jul 15 2016

Excellent 👍


@ravensorb commented on Fri Jul 15 2016

Hopefully that means its an easy fix 😀


@Sebazzz commented on Thu Aug 11 2016

The default bootstrapper script is wrong and over complicated. It evals an expression, and if you format your command line parameters a certain way, the expression becomes invalid.

I've added a pull request to fix the bootstrapper script.

Bootstrapper templates for Cake dotnet tool

I'm interested in helping on the bootstrapper templates/example for Cake using the dotnet tool, so opening this issue to discuss how they should look like.

✅ Things that come to mind of what the example bootstrapper should do (probably in this order):

  1. Ensure the bootstrapper stops in case of errors and forwards the exit code of the process that failed

  2. Change the working directory to the folder where the bootstrapper is located

    This is to make sure commands inside the bootstrapper are run in the expected directory relative to the bootstrapper. e.g.

  3. Disable the default caching of NuGet packages (a.k.a. "First Time Experience")

    This makes sense when running on temporary build nodes that are provisioned for each build (as the cache will be destroyed, so no point in having it enabled). For permanent build nodes on a self-hosted environment it might make sense to leave this enabled. I'd suggest a short comment with a link to a URL on the Cake website that explains more details and when it makes sense to disable or not

  4. Disable the .NET SDK telemetry feature

  5. Disable the .NET SDK welcome message

  6. Restore dotnet local tools (in case Cake is installed as a local tool)

    dotnet tool restore returns exit code 0 if a manifest is not found, so it's a safe call. If no manifest is found, the user just sees a warning message

  7. Run the dotnet-cake tool forwarding any arguments passed to the bootstrapper


❌ Things that come to mind of what the example bootstrapper shoud not do:

  1. Install .NET 5 or .NET Core

    Why not:

    • Devs using cloud-managed build servers that provision a temporary build node can usually rely on a ready-to-use image with .NET, Visual Studio, etc. already installed
    • Devs using self-hosted build servers usually have a dedicated team/person to manage the servers and perform one-time installs of .NET SDK, etc. as needed and build agents run with a low-privileged account that can't do much outside of the working folder (though I understand installing .NET in the local folder is a possibility, just don't think it's necessary).
  2. Install the Cake dotnet tool

    Why not:

    • I think most devs will be using dotnet-cake as a local tool through the tool-manifest and use that to pin the cake version they want to use for a project, store in source control, etc.
    • For devs that prefer to use dotnet-cake as a global tool, but are using a self-hosted build server, I don't think it's reasonable for one project to install (or update) a global tool that can affect other projects building on the same server. I think it's reasonable for the bootstrapper to expect the dotnet-cake tool to be pre-installed as a global tool if that's what the dev wants to use

Examples of the above (without comments, to simplify):

build.ps1

$ErrorActionPreference = 'Stop'

Set-Location -LiteralPath $PSScriptRoot

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$env:DOTNET_NOLOGO = '1'

dotnet tool restore
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

dotnet cake @args
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

build.sh

#!/usr/bin/env bash
set -euox pipefail

cd "$(dirname "${BASH_SOURCE[0]}")"

export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1

dotnet tool restore

dotnet cake $@

Undesirable side-effects due to environment variable created by bootstrapper

The bootstrapper creates three environment variables which are not cleared when the scripts concludes which means that these variables will remain effective as long as the PowerShell session is active.

This is a problem if a developer switches from the bootstrapper for .net framework (to build project A) to the bootstrapper for .net tool (to build project B) IN THE SAME POWERSHELL SESSION <-- this is important. You get weird errors that are hard to investigate. See this issue for an example where I struggled to figure out what was preventing me from building my project. @gep13 helped me investigate and we eventually figured out the presence of the environment variables what the culprit.

This problem goes away if you close PowerShell and open a new session but a safer solution would be to ensure the bootstrapper cleans up after itself.

build.sh file performance issue

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead
if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PA...

cat is a tool for con"cat"enating files. Reading a single file as input to a program is considered a Useless Use Of Cat (UUOC).
It's more efficient and less roundabout to simply use redirection. This is especially true for programs that can benefit from seek-able input, like tail or tar.
Many tools also accept optional filenames, e.g. grep -q foo file instead of cat file | grep -q foo.
Example of incorrect code:

cat file | tr ' ' _ | nl
cat file | while IFS= read -r i; do echo "${i%?}"; done

Example of correct code:

< file tr ' ' _ | nl  
while IFS= read -r i; do echo "${i%?}"; done < file

Add a readme file

Since the resources in this repo need to be pulled down manually, it would help to have a description right here about how to inject cake into an existing project using the bootstrapper scripts. Some ideas about how to maintain the copied scripts, in case of issues fixed in the future might help as well.

build.sh not working if nuget.config present

If a nuget.config file containing a repository path is present the build.sh script is not working as expected since the cake executable is extracted to the wrong directory.

build.sh output:

Downloading packages.config...
Downloading NuGet...
Feeds used:
  https://api.nuget.org/v3/index.json

Restoring NuGet package Cake.0.30.0.
  GET https://api.nuget.org/v3-flatcontainer/cake/0.30.0/cake.0.30.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/cake/0.30.0/cake.0.30.0.nupkg 20ms
Installing Cake 0.30.0.
Adding package 'Cake.0.30.0' to folder '/builds/tobiaskoch/LinkTime/Build/Packages'
Added package 'Cake.0.30.0' to folder '/builds/tobiaskoch/LinkTime/Build/Packages'
Could not find Cake.exe at '/builds/tobiaskoch/LinkTime/Tools/Cake/Cake.exe'.

This happens due to a missing "-OutputDirectory" command line argument in the build.sh script (that is present in the build.ps1 script).

I've prepared pull request #64 to fix the issue.

Parent tasks do not support periods in the task name.

What You Are Seeing?

More than one build script specified.

What is Expected?

Able to have a task name reflect a dotnet project name which contains a period; i.e. Project.Identifier.

What version of Cake are you using?

0.33.0

Are you running on a 32 or 64 bit system?

64-bit

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

image

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

No, local with both PS Core and PS Framework.

// PS Framework
> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

//PS Core
> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.3
PSEdition                      Core
GitCommitId                    6.1.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

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

> Invoke-WebRequest https://cakebuild.net/download/bootstrapper/windows -OutFile build.ps1

> Invoke-WebRequest https://gist.github.com/mxplusb/fbfd448e58239271fac976573d887182 -OutFile build.cake

// expected for testing purposes.
> .\build.ps1
Preparing to run build script...
Running build script...
Error: One or more errors occurred.
        Argument 'target' was not set.

// "Welcome" target works as intended.
> .\build.ps1 -Target "Welcome"
Preparing to run build script...
Running build script...

========================================
Welcome
========================================
Welcome to the Project Build Environment.

Below is a list of built targets available. Read the details before compiling, it may matter. To build a given target, just call `build.ps1 -Target <T>`.
Happy coding.

Build Target                             Description
=================================================================================================================================================================================================
Project.DevServer                       - Compiles the Project Development Server, which can be easily used for quick and dirty local development.
Constants.Vault                          - Generates the necessary constants for building, and then resets the files. Not for direct use as it will generate the files then immediate reset them.

// will fail because of the period.
> .\build.ps1 -Target Project.DevServer
Preparing to run build script...
Running build script...
More than one build script specified.
For usage, use parameter --help

// rename "Project.DevServer" to "Project" in cakefile
> .\build.ps1 -Target "Project"
Preparing to run build script...
Running build script...

========================================
Constants.Vault
========================================

========================================
Project
========================================

Task                          Duration            
--------------------------------------------------
Constants.Vault               00:00:00.0092790    
Project                       00:00:00.0016905    
--------------------------------------------------
Total:                        00:00:00.0109695

### Output Log

```powershell
> .\build.ps1 -Target "Project" -Verbosity Diagnostic
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing P:/aperture/keystone/build.cake...
Processing build script...
Installing addins...
Found package 'Cake.FileHelpers 3.2.0' in 'P:/aperture/keystone/tools/Addins'.
Package Cake.FileHelpers.3.2.0 has already been installed.
Successfully installed 'Cake.FileHelpers 3.2.0' to P:/aperture/keystone/tools/Addins
Executing nuget actions took 29.23 ms
The addin Cake.FileHelpers will reference Cake.FileHelpers.dll.
Verifying assembly 'Cake.FileHelpers, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null'.
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.FileHelpers.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.BuildServer...
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.Label...
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.FileHelpers...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
Compiling build script...

========================================
Constants.Vault
========================================
Executing task: Constants.Vault
Finished executing task: Constants.Vault

========================================
Project
========================================
Executing task: Project
Finished executing task: Project

Task                          Duration            
--------------------------------------------------
Constants.Vault               00:00:00.0057305    
Project                       00:00:00.0012355    
--------------------------------------------------
Total:                        00:00:00.0069660    

Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

Environemnt

I have clean windows docker image with following versions of .Net Framework installed:

Microsoft .NET Framework 4.6 Targeting Pack
Microsoft .NET Framework 4.6.1 Developer Pack
Microsoft .NET Framework 4.6.1 SDK
Microsoft .NET Framework 4.6.1 Targeting Pack
Microsoft .NET Framework 4.6.1 Targeting Pack (ENU)
Microsoft .NET Framework 4.6.2 Developer Pack
Microsoft .NET Framework 4.6.2 SDK
Microsoft .NET Framework 4.6.2 Targeting Pack
Microsoft .NET Framework 4.6.2 Targeting Pack (ENU)
Microsoft .NET Framework 4.7.1 Developer Pack
Microsoft .NET Framework 4.7.1 SDK
Microsoft .NET Framework 4.7.1 Targeting Pack
Microsoft .NET Framework 4.7.1 Targeting Pack (ENU)

Execution script

#addin "nuget:?package=Cake.Npm&version=0.13.0"

var target = Argument("target", "Default");

Task("NpmInstall")
	.Does(() => 
		{
			NpmInstall();
		}
	);

Task("Default")
	.IsDependentOn("NpmInstall")
;

RunTarget(target);

Cake version

Tried on 0.26.0 and 0.26.1

Expected result

Script to be executed successfully without any errors, npm packages are installed

Actual result

Preparing to run build script...
Running build script...
Error: Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.