Search code examples
entity-frameworkasp.net-core.net-core-rc2dotnet-cli

DOTNET CLI RC2 EF migrations


I just migrated to RC2 from RC1 and having a really hard time getting the ef commands and migrations to work.

I've read several other questions and have ran into the problem that's getting described in this link as a known issue.

The problem is that if I follow the instructions and create a brand new console application (.core) I'm still getting the following message:

This preview of Entity Framework tools does not support targeting class library projects in ASP.NET Core and .NET Core applications. See http://go.microsoft.com/fwlink/?LinkId=798221 for details and workarounds.

What am I doing wrong? Do I need to revert to rc1?


Solution

  • How did you do this migration ? I ask because in my case everything works time - as for now.

    In my case I have removed all RC1 components first and then I have installed new RC2 components...

    Next I have created new APS project using new Visual Studio Templates to get correct references and just moved my code to this new project.

    Of course it's few things which I had to update in my code, but everything works fine for me including ef commands and migrations.


    As you can read in ASP.NET Core installation guide

    Before you start

    Remove all previous versions of .NET Core from your system by using Add/Remove programs.

    You need RC1 setup file to uninstall this component - if you do not have it, check StackOverflow - you can find link to download missing files.


    Try follow the docs:

    ASP.NET 5 RC1 apps were based on the .NET Execution Environment (DNX) and made use of DNX specific features. ASP.NET Core RC2 is based on .NET Core, so you must first migrate your application to the new .NET Core project model. See Migrating from DNX to .NET Core CLI for more information.


    Hope this help you :)