Skip to content

[Feature Request]: Make error message more helpful when TaskItem.ItemSpec is not set #10660

Description

@MangelMaxime

Summary

Hello,

Improve error message if ItemSpec is missing on a TaskItem

Background and Motivation

When creating a custom MSBuild task, it took me several hours to figure out why I was getting this error:

error MSB4028: The "EasyBuild.PackageReleaseNotes.Tasks.GetCurrentReleaseTask" task's outputs could not be retrieved from the "CurrentRelease" parameter. Parameter "includeEscaped" cannot have zero length.

The reason was that I didn't set the TaskItem.ItemSpec value.

Proposed Feature

Improve the error message to mention that ItemSpec should be set.

The "EasyBuild.PackageReleaseNotes.Tasks.GetCurrentReleaseTask" task's outputs could not be retrieved from the "CurrentRelease" parameter. Please set the value of ItemSpec, in your task.

Alternative Designs

Another solution would be to change the constructor of TaskItem to take a mandatory ItemSpec value, but I suspect it would be too big of a breaking change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: DebuggabilityIssues impacting the diagnosability of builds, including logging and clearer error messages.Area: DocumentationIssues about docs, including errors and areas we should extend (this repo and learn.microsoft.com)Feature RequestPriority:3Work that is nice to havetriaged

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions