Skip to content

Commit b01949b

Browse files
Merge pull request #13975 from MicrosoftDocs/ghogen-patch-580539
Update property functions article
2 parents 51736c1 + 82a10f9 commit b01949b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/msbuild/property-functions.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Use property functions to call .NET methods
33
description: Use property functions to call .NET methods that appear in MSBuild property definitions, and see examples for working with the properties and methods.
4-
ms.date: 04/29/2024
4+
ms.date: 6/4/2025
55
ms.topic: how-to
66
helpviewer_keywords:
77
- MSBuild, property functions
@@ -12,7 +12,9 @@ ms.subservice: msbuild
1212
---
1313
# Property functions
1414

15-
Property functions are calls to .NET methods that appear in MSBuild property definitions. Unlike tasks, property functions can be used outside of targets. Property functions are evaluated whenever the properties or items get expanded. So, for properties and items outside of any targets, property functions are evaluated before any target runs. For property groups and item groups inside targets, property functions are evaluated when the target is evaluated.
15+
Property functions are calls to .NET methods that appear in MSBuild property definitions. You typically use them to construct property definitions that require more complex logic.
16+
17+
Unlike tasks, property functions can be used outside of targets. Property functions are evaluated whenever the properties or items get expanded. So, for properties and items outside of any targets, property functions are evaluated before any target runs. For property groups and item groups inside targets, property functions are evaluated when the target is executed.
1618

1719
Without using MSBuild tasks, you can read the system time, compare strings, match regular expressions, and perform other actions in your build script. MSBuild will try to convert string to number and number to string, and make other conversions as required.
1820

@@ -128,6 +130,9 @@ In addition, you can use the following static methods and properties:
128130
- [System.IO.File::GetLastAccessTime](/dotnet/api/System.IO.File.GetLastAccessTime?view=netstandard-2.0&preserve-view=true)
129131
- [System.IO.File::GetLastWriteTime](/dotnet/api/System.IO.File.GetLastWriteTime?view=netstandard-2.0&preserve-view=true)
130132
- [System.IO.File::ReadAllText](/dotnet/api/System.IO.File.ReadAllText?view=netstandard-2.0&preserve-view=true)
133+
- [System.Globalization.CultureInfo::GetCultureInfo](/dotnet/api/System.Globalization.CultureInfo.GetCultureInfo?view=netstandard-2.0&preserve-view=true)
134+
- [System.Globalization.CultureInfo::new](/dotnet/api/System.Globalization.CultureInfo.-ctor?view=netstandard-2.0&preserve-view=true)
135+
- [System.Globalization.CultureInfo::CurrentUICulture](/dotnet/api/System.Globalization.CultureInfo.CurrentUICulture?view=netstandard-2.0&preserve-view=true)
131136

132137
:::moniker range="vs-2022"
133138
#### System.OperatingSystem property functions

0 commit comments

Comments
 (0)