Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot use Add-Migrations #32

Open
caiovitor opened this issue Jun 21, 2023 · 1 comment
Open

[BUG] Cannot use Add-Migrations #32

caiovitor opened this issue Jun 21, 2023 · 1 comment
Assignees

Comments

@caiovitor
Copy link

Describe the bug
When I try to use Add-Migration DbInit -context OrdersContext in project DevStore.Orders.Infra I got this error bellow:
image

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Package Manage Console'
  2. Select the project 'DevStore.Orders.Infra'
  3. Run the command 'Add-Migration DbInit -context OrdersContext'
  4. See error

Expected behavior
Generate migrations files

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Visual Studio Community 2022

Additional context
Add any other context about the problem here.

@TiagoCastilhos
Copy link

You need to specify your startup project, which would be the api project.

Try opening a CMD in "src/services" directory and exeute the following command:

dotnet ef migrations add "DbInit" -s .\DevStore.Orders.AP\DevStore.Orders.API.csproj -p .\DevStore.Orders.Infra\DevStore.Orders.Infra.csproj --context OrdersContext

NOTE: This command can run at any directory of your application, you just have to set the proper path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants