豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 2.2 KB

File metadata and controls

43 lines (32 loc) · 2.2 KB
title NuGet Warning NU5129
description NU5129 Warning code
author zivkan
ms.date 09/19/2019
ms.topic reference
ms.reviewer karann
f1_keywords
NU5129

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.