Edit

Share via


MSB4023 diagnostic code

This article describes the MSB4023 error code.

Message text

MSB4023: Cannot evaluate the item metadata 'value'.

Description

This error occurs when the value of an item metadata can't be computed, usually because the item wasn't a file or path, but the metadata only applies to files or paths. For example, this error occurs if you try to invoke the %(RootDir) metadata, but the item is not a path.

Resolution

Review the build logic in the project file or one of its imported where the error occurred. Check that the item in the expression that causes this error is valid and set correctly, or remove the use of that metadata. Refer to the documentation for the metadata at MSBuild well-known item metadata.

To help debug the issue, generate a diagnostic log (use the -v:diag MSBuild command-line option), or generate a binary log (-bl command-line option) and use the MSBuild Structured Log Viewer.

Applies to

All versions of MSBuild