Skip to content

Comments

Fix ProjectMigrateErrorMessage to correctly describe packages.config to PackageReference migration#6827

Closed
Copilot wants to merge 3 commits intodevfrom
copilot/fix-26bb38f0-8323-496d-822d-63fe5ddc6a7d
Closed

Fix ProjectMigrateErrorMessage to correctly describe packages.config to PackageReference migration#6827
Copilot wants to merge 3 commits intodevfrom
copilot/fix-26bb38f0-8323-496d-822d-63fe5ddc6a7d

Conversation

Copy link
Contributor

Copilot AI commented Oct 2, 2025

Summary

Fixes the misleading error message shown when a project is not eligible for migration from packages.config to PackageReference.

Problem

The error message ProjectMigrateErrorMessage incorrectly stated:

"Project is not eligible for migration as it's not project.json based."

This message was confusing and incorrect because:

  1. The migration feature is for upgrading packages.config projects to PackageReference, not for project.json projects
  2. Project.json has been deprecated and is no longer recommended
  3. The message suggested users should use project.json, which contradicts current best practices

Solution

Updated the error message to accurately describe the migration requirements:

"Project is not eligible for migration. Either the project is not packages.config based or doesn't support PackageReference yet."

This message now:

  • Correctly identifies that the project must be packages.config based
  • Explains why migration might not be available (project doesn't support PackageReference)

Context

The message is displayed in Visual Studio when users attempt to migrate a project using the "Migrate packages.config to PackageReference..." command, but the project is not eligible. The underlying code (NuGetProjectUpgradeUtility.IsNuGetProjectUpgradeableAsync) specifically checks for packages.config projects that support PackageReference, confirming this is a packages.config → PackageReference migration, not a project.json migration.

Fixes #14099

Original prompt

This section details on the original issue you should resolve

<issue_title>Migrator (PC to PR) shouldn't suggest using project.json project</issue_title>
<issue_description>### NuGet Product Used

Visual Studio Package Management UI

Product Version

any

Worked before?

No response

Impact

None

Repro Steps & Context

The error, 'Project is not eligible for migration as it's not project.json based.', is incorrectly suggesting to use project.json projects.

ProjectMigrateErrorMessage should be revised.

<data name="ProjectMigrateErrorMessage" xml:space="preserve">

Verbose Logs

```</issue_description>

<agent_instructions>This should only be relevant to packages.config projects, not project.json projects. In fact, we have deprecated project.json. Can the string resource be updated accordingly?</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>
Fixes NuGet/Home#14240

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…to PackageReference migration

Co-authored-by: donnie-msft <49205731+donnie-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrator (PC to PR) shouldn't suggest using project.json project Fix ProjectMigrateErrorMessage to correctly describe packages.config to PackageReference migration Oct 2, 2025
Copilot AI requested a review from donnie-msft October 2, 2025 22:32
@donnie-msft
Copy link
Contributor

@copilot please remove the URL portion and it's good to go

Co-authored-by: donnie-msft <49205731+donnie-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 2, 2025

@copilot please remove the URL portion and it's good to go

Done! Removed the URL portion from the error message in commit cc51c6d.

@donnie-msft donnie-msft closed this Oct 2, 2025
@nkolev92 nkolev92 deleted the copilot/fix-26bb38f0-8323-496d-822d-63fe5ddc6a7d branch February 6, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrator (PC to PR) shouldn't suggest using project.json project

2 participants