Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes the MSB4066 error code.
Message text
MSB4066: The attribute 'value' in element 'value' is unrecognized.
Remarks
This error occurs when MSBuild encounters an XML attribute in a project file or target file that it doesn't recognize. MSBuild validates the attributes of elements in project files to ensure they adhere to the correct MSBuild syntax and supported attributes for each element.
Possible causes
The error is typically caused by one of the following:
- A typo in an attribute name within an MSBuild project file (for example,
.csproj
,.vbproj
, or.proj
). - Use of an unsupported or obsolete attribute in a project file.
- Use of metadata in an attribute in a version of MSBuild that doesn't support this construct.
- An attribute was added to the project file but isn't recognized by your version of MSBuild.
Some schema elements, such as Choose
, don't allow any attributes, so if you try use one, such as adding a Condition
, you get this error.
Resolution
Check for typos: Verify that the attribute name is spelled correctly and matches the expected schema.
Remove unsupported attributes: Cross-reference the MSBuild documentation to ensure that the attribute is valid for the specific element. See MSBuild project file schema reference.
Use the metadata syntax supported by the MSBuild version you're using: If the problem is using metadata as an attribute (for example,
Version="1.0"
whereVersion
is actually metadata, not an attribute), then you can change to the old metadata syntax.<PackageReference Include="System.Diagnostics.Process"> <Version>1.0</Version> </PackageReference>
Support for specifying item metadata as attributes was added between MSBuild 14 and MSBuild 15.
Update MSBuild version: If the attribute is new and not recognized, ensure you're using a version of MSBuild that supports it.
Applies to
All versions of MSBuild