Skip to content

Commit b187bf8

Browse files
Merge pull request #13695 from MicrosoftDocs/ghogen-patch-592498
Add explanatory text for error condition and link to more information
2 parents 4e68004 + af7be7a commit b187bf8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/msbuild/errors/msb4099.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "MSB4099 diagnostic code"
33
description: "A reference to an item list at position 'value' is not allowed in this condition 'value'."
4-
ms.date: 12/06/2024
4+
ms.date: 3/11/2025
55
ms.topic: "error-reference"
66
f1_keywords:
77
- MSB4099
@@ -26,14 +26,15 @@ This article describes the MSB4099 error code.
2626

2727
## Message text
2828

29-
```output
30-
MSB4099: A reference to an item list at position 'value' is not allowed in this condition 'value'.
31-
```
29+
`MSB4099: A reference to an item list at position 'value' is not allowed in this condition 'value'.`
3230

3331
<!-- :::editable-content name="postOutputDescription"::: -->
3432
<!--
3533
{StrBegin="MSB4099: "}
3634
-->
35+
This error occurs when a project is using an item in a condition in a context where it's not yet available for use. MSBuild evaluates a project file using multiple passes. `Import` elements, top-level `PropertyGroup` elements, and their `Property` elements are evaluated before items are evaluated. As a result, items are unavailable at the point when those elements are evaluated. Therefore, you can't use items in conditions in any of those elements. See [How MSBuild builds projects](../build-process-overview.md#evaluation-phase).
36+
37+
To fix this issue, restructure your logic to avoid the need to reference an item in a condition in an `Import` element, `PropertyGroup` element, or `Property` element at the top level.
3738
<!-- :::editable-content-end::: -->
3839
<!-- :::ErrorDefinitionDescription-end::: -->
3940

0 commit comments

Comments
 (0)