dotnet / upgrade-assistant

A tool to assist developers in upgrading .NET Framework applications to .NET 6 and beyond
MIT License
1.11k stars 163 forks source link

Instructions for testing mappings does not work with NuGet package #1597

Open CoolDadTx opened 2 months ago

CoolDadTx commented 2 months ago

Describe the bug

I'm trying to test custom mappings. After producing a prerelease NuGet package I drop it into my local feed. Since I have multiple feeds defined for normal builds I followed the steps in the blog for creating a nuget.config in the solution directory for the solution I want to update. However the CLI doesn't seem to honor the custom source. The output displays this:

Found NuGet package Microsoft.UpgradeAssistant.Mappings v1.0.7
Using API and package mappings from D:\Packages\nuget\Microsoft.UpgradeAssistant.Mappings\1.0.7\content\mappings
  1. Based upon how NuGet cascades configurations I believe you need to add a <clear /> before the package source in the config. Otherwise it'll add it to whatever sources you've already configured.
  2. Irrelevant of the custom config though it is still pulling the packages from nuget.org it appears, or at least my local cache of it, because the output shows it getting the "official" mappings instead of my custom one.

To Reproduce

  1. Create a custom mapping package.
  2. Drop into a custom local feed.
  3. Define a nuget.config with the custom local feed.
  4. Run the tool and confirm it is pulling from the custom local feed and not the official one.

Exceptions (if any)

N/A

Further technical details