Uredi

Dijelite putem


MSB4211 diagnostic code

This article describes the MSB4211 error code.

Message text

MSB4211: The property 'value' is being set to a value for the first time, but it was already consumed at 'value'.

Remarks

This error occurs when a target in an MSBuild project file attempts to use a property that wasn't initialized at the point it was used, but it's assigned a value later in the build process.

It's not an error to use an uninitialized property. Such an undefined property simply gets the empty string as a value, but if the property is later assigned a value, this error occurs.

If you want MSBuild to warn for any uninitialized property, set the environment variable MSBUILDWARNONUNINITIALIZEDPROPERTY to 1.

Resolution

To resolve this error, ensure that the property in question is initialized before you use it. Since the property is given a value later, you might need to change the sequence of property settings or imports to ensure that the initialized occurs before reading the property's value.

Applies to

All versions of MSBuild