Edit

NuGet Warning NU1507

There are 2 package sources defined in your configuration. When using central package management, please map your package sources with 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

A project is configured to use NuGet Central Package Management and is not configured to use Package Source Mapping. It is highly recommended to enable Package Source Mapping because it safeguards your software supply chain when your project is consuming packages from multiple package sources by allowing you specify the source for each package.

Solution

You can resolve the warning manually:

  • Onboard to Package Source Mapping if you have more than one HTTP-based NuGet package source configured when using Central Package Management.
  • If you are unable to onboard to Package Source Mapping but want to use Central Package Management, you can suppress the warning:
<PropertyGroup>
  <!-- Suppress NU1507: There are 2 package sources defined in your configuration. When using central package management, please map your package sources with package source mapping or specify a single package source. -->
  <NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

Use GitHub Copilot

Ask the NuGet MCP server to review the warning by entering the following prompt in the GitHub Copilot Chat window:

Resolve NU1507 by reviewing my NuGet supply chain security configuration.

  • In Visual Studio 2026 version 18.11.0 or higher, select Ask Copilot for a fix (the sparkle icon) next to NU1507 in the Error List to use a shortcut that opens GitHub Copilot with this prompt.

GitHub Copilot uses the NuGet MCP server to review the repository's configuration. It might help you onboard to Package Source Mapping or help you decide whether to suppress the warning. Verify Copilot's analysis against your repository's requirements.

To use the NuGet MCP server, you must be signed in to GitHub Copilot and have the server enabled. For setup instructions, see Using the NuGet Model Context Protocol (MCP) Server.