Skip to content

Improve error message for reserved argument names #2794

Description

@augustoproiete

It seems that some argument names cannot be used as build arguments. For example, trying to use an argument called version throws the error Error: Argument value is not a valid boolean value.

build.cake

var version = Argument<string>("version", "1.0.0");
// ...

image

I'm guessing this is caused because version is already being used to show the tool version e.g. dotnet cake --version, which is reasonable.

However, it's not clear from the error message above why the error occurs. I'd suggest adding a validation and display a better error message and suggest a workaround such as "Use a different name such as appVersion, packageVersion, etc."


Using dotnet cake global tool v0.38.1

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions