NuGet Warning NU5129

At least one .<extension> file was found in '<build_folder>/<tfm>/', but '<build_folder>/<tfm>/<package_id>.<extension>' was not.

<extension> is one of: targets, props. <build_folder> is one of: build, buildTransitive, buildCrossTargeting, buildMultiTargeting. <tfm> is a Target Framework Moniker, or may be absent. <package_id> is the package identifier of your package.

Examples:

At least one .targets file was found in 'build/netstandard2.0/', but 'build/netstandard2.0/MyPackage.targets' was not.

At least one .props file was found in 'build/netstandard2.0/', but 'build/netstandard2.0/MyPackage.props' was not.

At least one .props file was found in 'buildTransitive/net472/', but 'buildTransitive/net472/My.Package.Id.props' was not.

At least one .targets file was found in 'buildMultitargeting/netcoreapp3.0/', but 'buildMultitargeting/netcoreapp3.0/Contoso.Utilities. targets' was not.

At least one .props file was found in 'build/', but 'build/AdventureWorks.Tools.props' was not.

Issue

Packages that include MSBuild props and targets need to follow the naming convention of using the package id before the .props or .targets extension. Files that do not follow this convention will not be imported into projects that use the package.

Example: If the package id is Contoso.Utilities and contains the files build/Contoso.Utilities.props and build/Utilities.targets, only the Contoso.Utilities.props file will be imported into projects using the package. Utilities.targets will not be imported by NuGet.

Solution

Rename the file to meet the convention.

In the above example, build/netstandard2.0/Utilities.targets should be renamed to build/netstandard2.0/Contoso.Utilities.targets for NuGet to start importing it. If Utilities.targets is being imported in Contoso.Utilities.props, then rename the file to use the .props extension as well.