dotnet / dotnet/modernize-dotnet

Feedback regarding NuGet packages.config -> PackageReference conversion

Open
#1,671 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
1.2k
Forks
181
PR merge metrics
No merged PRs in 30d

Description

### Description

Since **.NET Upgrade Assistant** got deprecated I tried to migrate a legacy project (old .csproj format) from packages.config to PackageReferences, but the results were pretty bad.

My prompt was the following:
> @Modernize migrate the [XY.csproj] from packages.config to PackageReferences. Put the PackageReferences, the Assembly References and the ProjectReferences to separate ItemGroups. Do not add comments to the .csproj file.

And the results were:
- First it put the PackageReferences to the same ItemGroup as the other references and added some useless comments. Luckily I could address these in my improved prompt (see above).
- It did not delete the packages.config file, just removed it from the .csproj file.
- It converted the AssemblyReferences (referencing from the Packages folder) to PackageReferences, instead of considering the content of packages.config -> It created a different list of PackageReferences that caused compilation errors.
- It modified a ProjectReference (totally unrelated from the actual change), it changed a single letter in a GUID to a wrong value (???)

It is possible that with further prompt engineering I could improve the results, but I would expect the new modernize tool to support what was previously supported in the deprecated tool.

We are in the middle of a modernization project where we would like to upgrade the packages management in hundreds of old project files. The deprecation of **.NET Upgrade Assistant** (that had an explicit feature for this conversion) and the lack of support in the new **AI based Modernize** tool makes it much harder than before.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.