NuGet Warning NU1507

Scenario 1

There are 2 package sources defined in your configuration. When using central package management, please map your package sources with package source mapping (https://aka.ms/nuget-package-source-mapping) or specify a single package source. The following sources are defined: https://api.nuget.org/v3/index.json,  https://contoso.myget.org/F/development/.

Issue

When using NuGet's central package management (CPM), it is highly recommended that you also use Package Source Mapping. This can help safeguard your software supply chain is crucial if you use a mix of public and private package sources. Visit https://aka.ms/nuget-package-source-mapping to learn more about how package source mapping works.

Solution

Onboard to Package Source Mapping if you have more than one NuGet feed configured when using central package management. You can visit https://aka.ms/nuget-package-source-mapping for more details.

If you are unable to onboard to Package Source Mapping but want to use central package management, can suppress the warning:

<PropertyGroup>
  <NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>