I recently was working on a WebAPI project. I added migrations and everything was fine. The migration files also got generated but weirdly, i am getting errors like "Migrations does not exist in the namespace"

Devang Khatri 20 Reputation points
2024-02-29T13:06:50.4833333+00:00

User's image

User's image

User's image

Entity Framework was installed properly and as you can see , everything should be as it is. How is this even possible?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,836 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 53,726 Reputation points
    2024-02-29T15:18:54.2933333+00:00

    The Migrations namespace is contained in the Microsoft.EntityFrameworkCore.Relational package. You don't have that package references in your code. Add a NuGet reference to that package and the namespace should be available.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.