Edit

Share via


MSB4068 diagnostic code

This article describes the MSB4068 error code.

Message text

MSB4068: The element 'value' is unrecognized, or not supported in this context.

Description

This error occurs when MSBuild is given an XML file to build, but the file isn't a project file. Specifically, MSBuild looks for the top-level Project XML element to see if it can process the input file as a valid project file, and if it doesn't find it, you get this error. The error text gives the name of whatever top-level element that was found.

Resolution

Check the file that was provided. Note that the file MSBuild tries to build might be found automatically. For example, if you invoke MSBuild in a project folder, it tries to find the project file or a solution file in that folder.

If you were using a tool that runs MSBuild, such as dotnet pack, check its documentation to ensure it is being invoked correctly. For example, if you invoke dotnet pack with a .nuspec file, which uses a different XML schema, the error references the package element found in those files.

If the provided file is a project file, check for any spelling or syntax errors in or near the top-level Project element.

Applies to

All versions of MSBuild