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

Create a migration failed with PowerShell command in PMC #27457

Closed
mm-ryo opened this issue Feb 16, 2022 · 2 comments
Closed

Create a migration failed with PowerShell command in PMC #27457

mm-ryo opened this issue Feb 16, 2022 · 2 comments

Comments

@mm-ryo
Copy link

mm-ryo commented Feb 16, 2022

Hi,

When I try to create a migration in Visual Studio PMC with the command 'Add-Migration'. It seems the ef-core tool tries to start our app and waits until the web host return timeout.
We just upgraded the framework to .net6 and vs2022 to v17.1.0. Before the upgrade, both commands are working fine.

Add-Migration Test1 -Project DAL\EF\Migrations -Context TestContext

Logs:
image

But it works if using the ef-core CLI command. it didn't start our app.

dotnet ef migrations add Test1 --project DAL\EF\Migrations --context TestContext

image

Include provider and version information

EF Core version: efcore 6.0.1
Database provider: Npgsql.EntityFrameworkCore.PostgreSQL
Target framework: .NET6
Operating system: Windows 10
IDE: VS2022 17.1.0

@mm-ryo
Copy link
Author

mm-ryo commented Feb 17, 2022

I just tested following steps. it seems working fine but there is a warning message.

  1. In VS2022 and to set other project which there is no entry point method as a startup project
  2. run 'Add-migration' command

An operation was scaffolded that may result in the loss of data. Please review the migration for accuracy.

It is obvious that there are some changes in 'Add-Migration'

@ajcvickers
Copy link
Contributor

Duplicate of #27306. Workaround in this comment: #27306 (comment)

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
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