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:

  1. Close your project/solution if it's open in Visual Studio, and take a backup of it.

  2. Open the .csproj file in a text editor

  3. Cut the ProjectGuid and ProjectTypeGuids entries, and paste them somewhere else temporarily.

  4. Insert <ProjectGuid>{7C796B6B-86B5-4C57-ADAA-12CF1FECDA71}</ProjectGuid> where your ProjectGuid entry was previously, and save the file

  5. Open the project in Visual Studio (2017 or later)

  6. Right-click the packages.config file and choose the option to migrate to package reference.

  7. Once the migration is successful, close the project/solution again.

  8. Go back into the .csproj file and replace the ProjectGuid entry with the ProjectGuid and ProjectTypeGuids entries which you saved in step 3.

  9. 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.