Skip to content

Commit 8431bbe

Browse files
authored
Merge pull request #8269 from psollberger/main
Added guidance for Defined() usage
2 parents 36fd5b8 + 3fdf48c commit 8431bbe

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/extensibility/vsct-xml-schema-conditional-attributes.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: VSCT XML Schema Conditional Attributes | Microsoft Docs
33
description: Learn how to apply conditional attributes to VSCT XML schema lists and items. Attributes evaluate to true or false, controlling the resulting output.
44
ms.custom: SEO-VS-2020
5-
ms.date: 11/04/2016
5+
ms.date: 07/13/2022
66
ms.topic: reference
77
helpviewer_keywords:
88
- VSCT XML schema elements, conditional attributes
@@ -20,7 +20,7 @@ ms.workload:
2020
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
2121
You can apply conditional attributes to all lists and items. Logical operators and symbol expansion expressions evaluate to true or false. If true, the associated list or item is included in the resulting output.
2222

23-
You can test token expansions against other token expansions or constants. The function `Defined()` tests whether a particular name has been defined, even if it has no value.
23+
You can test token expansions against other token expansions or constants. The function `Defined()` tests whether a particular name has been defined, even if it has no value. To define a name, use the `VSCTDefinitions` property in your project file.
2424

2525
When a Condition attribute is applied to a list, the condition is applied to every child element in the list. If a child element itself contains a Condition attribute, then its condition is combined with the parent expression by an AND operation.
2626

@@ -39,6 +39,16 @@ You can apply conditional attributes to all lists and items. Logical operators a
3939

4040
## Examples
4141

42+
### Project file
43+
44+
```xml
45+
<PropertyGroup>
46+
<VSCTDefinitions>DEMO_SKU</VSCTDefinitions>
47+
</PropertyGroup>
48+
```
49+
50+
### VSCT file
51+
4252
```xml
4353
<Menu Condition="Defined(DEBUG)" ...
4454
</Menu>

0 commit comments

Comments
 (0)