Search code examples
c#visual-studiomigrate

VS 2015 to 2017 migrate to package reference failed


I've inherited a VS-2015 C# application and would like to migrate it to VS 2017 or 2019. It has a packages.config file with 4 packages:

<package id="AjaxControlToolkit" version="15.1.4.0" targetFramework="net4" />
<package id="EntityFramework" version="6.0.0" targetFramework="net4" />
<package id="Microsoft.AspNet.Providers" version="2.0.0" targetFramework="net4" />
<package id="Microsoft.AspNet.Providers.Core" version="2.0.0" targetFramework="net4" />

The first few lines of the project's sln file are:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}")

I'd like to migrate the packages.config file to a csproj file.

In Visual Studio 2017, I tried migrating it by right-clicking on packages.config and clicking 'Migrate packages.config to PackageReference', but it gives me an error:

Operation Failed - Project is not Eligible for Migration.

error message

I also tried this tool: https://github.com/hvanbakel/CsprojToVs2017 and this also fails.

Is there really no way to migrate this to .csproj?


Solution

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