Skip to content

Commit bb7846e

Browse files
authored
Add Feature Availability Document Page (#9980)
* add doc page for Feature Availability
1 parent 053feb0 commit bb7846e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# What is Feature Availablity?
2+
Feature Availability is an API that can tell you the availability status of the specific feature of the MSBuild engine. Feature names are represented by strings and availability is an enum `FeatureStatus` with the following values:
3+
* `Undefined` - the availability of the feature is undefined (the feature might or might not be supported by the current MSBuild engine - the feature is unknown to the feature availability checker, so it cannot be decided).
4+
* `Available` - the feature is available
5+
* `NotAvailable` - the feature is not available (unlike `Undefined`, the feature name is known to the feature availability checker and it knows the feature is not supported by current MSBuild engine)
6+
* `Preview` - the feature is in preview (not stable)
7+
8+
# How to use?
9+
## API
10+
In `Microsoft.Build.Framework` use `FeatureStatus Features.CheckFeatureAvailability(string featureName)` to get the feature availability.
11+
12+
## Command line switch
13+
Use `/featureavailability`(`-featureavailability`) or `/fa` (`-fa`) switches.
14+
15+
## Property function `CheckFeatureAvailability`
16+
Use `string CheckFeatureAvailability(string featureName)` property function.
17+
```xml
18+
<PropertyGroup>
19+
<FeatureAvailability>$([MSBuild]::CheckFeatureAvailability('FeatureA'))</FeatureAvailability>
20+
</PropertyGroup>
21+
```
22+
23+
# Current Features
24+
See [Framework.Features.cs](https://github.com/dotnet/msbuild/blob/main/src/Framework/Features.cs)

0 commit comments

Comments
 (0)