Base solution for your next web application
Open Closed

Does Zero 4.0 support upgrade from Zero 3.4? #3017


User avatar
0
trendline created

As EF Core replaced EF 6.x, migration records also restart, does Zero 4.0 still support upgrade from previous versions? such as Zero 3.4


13 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you are going to use .Net Framework 4.6.1, it should be easy to update from 3.4. But if you are going to use .Net Core, it will be harder to update.

  • User Avatar
    0
    trendline created

    Is that existing migration record which generated by EF.migrator still could use in EF core pack manager console?

  • User Avatar
    0
    alirizaadiyahsi created

    Hi,

    If you want to use EF Core, you can't use existing migrations. Moving to EF Core is not an easy progress. You can read this blog post. <a class="postlink" href="http://volosoft.com/net-core-support-for-asp-net-boilerplate-and-asp-net-zero/">http://volosoft.com/net-core-support-fo ... -net-zero/</a>

  • User Avatar
    0
    joe704la created

    I am using .Net Framework 4.6.1 but I am having a ton of issues updating to the 4.0 version as well as migrations are completely different. So I don't believe it is an easy upgrade as it has been in the past since it now uses EntityFramework Core project instead. It kept trying to create new tables and getting hung up on the tables that were already there. It wasn't updating the changes or anything. I tried a fresh database just to see if I could get the creation to work but it wouldn't seed the database. So I am not sure what to do at this point.

  • User Avatar
    0
    joe704la created

    Another thing I just tried and failed was doing a brand new fresh download and trying to Update-Database in the Package manager console and I am getting "Could not load file or assembly 'Microsoft.EntityFrameworkCore.Design' or one of its dependencies. The system cannot find the file specified."

    I shut down visual studio, I cleaned the solution rebuilt it, and triple checked that I have the EntityFrameworkCore as the selected default project in Package Manager Console.

  • User Avatar
    0
    joe704la created

    Anyone else having as many issues as I am with the 4.0 upgrade? I finally got the migrations to create the tables but it never runs the seed methods

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @joe704la,

    You are right, it is a hard process. For your last problem, EF Core does not have seed anymore, so we moved seed method to app initialization here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.EntityFrameworkCore/EntityFrameworkCore/AbpZeroTemplateEntityFrameworkCoreModule.cs#L40">https://github.com/aspnetzero/aspnet-ze ... ule.cs#L40</a>.

    You need to run your app to run seed method.

  • User Avatar
    0
    joe704la created

    Oh I see, thank you

  • User Avatar
    0
    trendline created

    <cite>joe704la: </cite> Another thing I just tried and failed was doing a brand new fresh download and trying to Update-Database in the Package manager console and I am getting "Could not load file or assembly 'Microsoft.EntityFrameworkCore.Design' or one of its dependencies. The system cannot find the file specified."

    I shut down visual studio, I cleaned the solution rebuilt it, and triple checked that I have the EntityFrameworkCore as the selected default project in Package Manager Console.

    @joe704la, How to resolve this issue finally?

    Copy to a clean solution, when run the update-database encountered "The EntityFramework package is not installed on project", did you see this error too?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @trendline,

    Did you make Web project as startup project ? This errror might be related to that.

  • User Avatar
    0
    joe704la created

    @trendline I have had a ton of issues with this and no haven't completely gotten it yet. If I figure something out I will reply here. If you figure something out, let me know.

  • User Avatar
    0
    trendline created

    @ismcagdas , yes, the MVC project as the startup project.

    @joe704la , I found the reason about "The EntityFramework package is not installed on project", it is because EntityFramework and EntityFrameworkCore both are installed on the solution, but I checked didn't find EntityFramework installed. Current, I am add a prefix before the command in PM console, such as "EntityFrameworkCore\Update-Database", it works with the command in EntityFrameworkCore.

    I also customized some entity mapping configuration to mapping entity to database.

  • User Avatar
    0
    joe704la created

    Nice find. I will try that out.