Skip to content

Commit 12ec34c

Browse files
Merge pull request #14212 from ghogen/property-functions-out-parameters
Document out param in property function
2 parents 35c6e26 + b253e16 commit 12ec34c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/msbuild/property-functions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ For example, to set a build property to a new GUID, you can use this script:
6262
<NewGuid>$([System.Guid]::NewGuid())</NewGuid>
6363
```
6464

65+
For overloaded methods, MSBuild tries to find a method with matching parameters.
66+
67+
In MSBuild 17.14 and later, you can use the parameter syntax `out _` to specify an `out` parameter. See [Reference parameters](/dotnet/csharp/language-reference/keywords/method-parameters#reference-parameters). The `out` parameter value is ignored. For example:
68+
69+
```xml
70+
<IsInteger>$([System.Int32]::TryParse("123", out _))</IsInteger>
71+
```
72+
73+
The property `IsInteger` is `true` if the input is successfully parsed as an integer, but the parsed value is ignored.
74+
6575
In static property functions, you can use any public static method or property defined in .NET Standard 2.0 for these system classes:
6676

6777
- [System.Byte](/dotnet/api/System.Byte?view=netstandard-2.0&preserve-view=true)

0 commit comments

Comments
 (0)