VS 2015 to 2017 migrate to package reference failed
There is a workaround to this issue that I have used for older ASP.NET projects (and may potentially work with other project types which exhibit this issue too).
Essentially, the migration tool can still work, but first you must fool Visual Studio (temporarily) into thinking your project is a class library rather than a web project while you do the migration.
Detailed steps:
Close your project/solution if it's open in Visual Studio, and take a backup of it.
Open the .csproj file in a text editor
Cut the
ProjectGuid
andProjectTypeGuids
entries, and paste them somewhere else temporarily.Insert
<ProjectGuid>{7C796B6B-86B5-4C57-ADAA-12CF1FECDA71}</ProjectGuid>
where yourProjectGuid
entry was previously, and save the fileOpen the project in Visual Studio (2017 or later)
Right-click the packages.config file and choose the option to migrate to package reference.
Once the migration is successful, close the project/solution again.
Go back into the .csproj file and replace the
ProjectGuid
entry with theProjectGuid
andProjectTypeGuids
entries which you saved in step 3.Re-open the project in Visual Studio. You should now be able to use it as normal.
This has worked for me on two projects so far. I can't promise there wouldn't be any side-effects in edge cases or more complex projects, but it's certainly something you can try.
Credit to this GitHub comment for the idea.
According to the documentation:
Migration is not currently available for C++ and ASP.NET projects.
The migration (through right-clicking on the packages file) works fine for console applications for example.