dotnet / dotnet/msbuild

Consider supporting nullable task parameters

Open
#4,729 2 comments 3 reactions 0 assignees View on GitHub
Area: Engine triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

With a simple task:

```C#
public class DoNothing : Microsoft.Build.Utilities.Task {

public virtual bool? Parameter1 {
get ;
set ;
}

public override bool Execute() {
Log.LogError(Parameter1.ToString());

return Success;
}
}
```

and a simple project:

```xml



```

MSBuild errors, because it doesn't know how to handle `Nullable`, even when `T` is a nice, known type:

```
C:\Users\raines\foo.proj(22,16): error MSB4030: "true" is an invalid value for the "Parameter1" parameter of the "DoNothing" task. The "Parameter1" parameter is of type "System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]".
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.