You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/msbuild/property-functions.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ Here is a list of MSBuild property functions:
209
209
|`bool DoesTaskHostExist(string runtime, string architecture)`|Returns whether a task host is currently installed for the specified runtime and architecture values. See [MSBuild DoesTaskHostExist](#msbuild-doestaskhostexist). |
210
210
|`string Escape(string unescaped)`|Escape the string according to MSBuild escaping rules.|
211
211
|`string EnsureTrailingSlash(string path)`|If the given path doesn't have a trailing slash then add one. If the path is an empty string, does not modify it. See [MSBuild EnsureTrailingSlash](#msbuild-ensuretrailingslash).|
212
-
|`string FilterTargetFrameworks(string incoming, string filter)`|Return the list of the target frameworks that match the specified filter. An target framework from `incoming` is kept if it is compatible with any of the desired target frameworks on `filter`. See [MSBuild TargetFramework and TargetPlatform functions](#msbuild-targetframework-and-targetplatform-functions).|
212
+
|`string FilterTargetFrameworks(string incoming, string filter)`|Return the list of the target frameworks that match the specified filter. A target framework from `incoming` is kept if it is compatible with any of the desired target frameworks on `filter`. See [MSBuild TargetFramework and TargetPlatform functions](#msbuild-targetframework-and-targetplatform-functions).|
213
213
|`string GetCurrentToolsDirectory()`| Get the current MSBuild tools directory. |
214
214
|`string GetMSBuildExtensionsPath()`| Gets the MSBuild extensions path. When running *MSBuild.exe*, this is usually the MSBuild executable folder. When running in Visual Studio, this is the MSBuild subfolder under the Visual Studio installation folder. |
215
215
|`string GetMSBuildSDKsPath()`| Gets the directory where SDKs are expected, for the current MSBuild instance.|
@@ -547,6 +547,14 @@ Value6 = False
547
547
Value7 = False
548
548
```
549
549
550
+
### MSBuild FilterTargetFrameworks
551
+
552
+
You can use this property function to select a subset of list of Target Framework Monikers (TFMs), to restrict the list to those frameworks that are compatible with the list of TFMs given the filter argument.
553
+
554
+
For example, if `incoming` is `net6.0;net7.0;netstandard2.0` and `filter` is `net7.0;netstandard2.0`, the result is `net7.0;netstandard2.0`.
555
+
556
+
A TFM in the incoming list or in the filter may omit the version, such as `net` or `netstandard`, in which case it matches all versions.
557
+
550
558
## MSBuild version-comparison functions
551
559
552
560
MSBuild 16.5 and higher define several functions for comparing strings that represent versions.
0 commit comments