-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
dbcontext scaffold falsely states: "Missing required argument '<PROVIDER>'." #24251
Comments
@bricelam I am able to reproduce this. Looks like .NET 6 is breaking the dotnet-ef tool. |
dotnet exec ...\ef.dll dbcontext scaffold connection Microsoft.EntityFrameworkCore.SqlServer Weird stuff. The first three arguments are definitely getting parsed... I'll need to debug to fully understand what's going on. |
/cc @dsplaisted (in case this rings a bell...) |
We switched to a new command line parser for .NET 6 so that's likely related. @sfoslund Can you look at this? |
I'm not able to repro this issue with 6.0.100-preview.2.21120.3 and dotnet-ef version 5.0.3, it's possible that it was fixed by one of the changes that didn't make it into preview 1. @ajcvickers were you also reproducing with preview 1? |
@sfoslund Yes, I also used preview 1. |
Great, unless anyone can repro this with preview 2 it can probably be closed as fixed. |
@sfoslund Thanks. We will verifiy with preview 2. |
It's not related to the recent SDK changes. This was caused by some bad code cleanup in PR #22625. |
An update to dispose all the things in PR dotnet#22625 accidentally broke our argument parsing logic. This updates that change to preserve the original logic. Fixes dotnet#24251
An update to dispose all the things in PR dotnet#22625 accidentally broke our argument parsing logic. This updates that change to preserve the original logic. Fixes dotnet#24251
Yeah. Preview 2 still does this. We'll wait for the next one patently ;-) |
@IvanFarkas I suspect going back to the 5.0 tool will work. The tool itself is a thin wrapper and is designed to be as forward compatible as possible. |
I'm getting this error with preview 2 so I can confirm that the error is still happening. I'm using the package manager console through Visual Studio |
I tried going back to 5.0 and for some reason it still gave me the same error for the package manager console but it worked for the command line interface |
Please install the 5.0.0 version and close the visual studio and re-open |
I too faced the same issue with .Net 5.0, Please make sure below are done.
scaffold-dbcontext -provider Microsoft.EntityFrameworkCore.SqlServer -connection "Server=(localdb)\MSSQLLocalDB;Database=EFCoreMigration;Trusted_Connection=True;user id=test;password=test;” -OutputDir Models This worked for me, pleased let me know the feedback |
Entity Framework Core .NET Command-line Tools 6.0.0-preview.1.21102.2
Calling
dotnet ef dbcontext scaffold "context" provider
results in error message
Missing required argument '<PROVIDER>'.
Obviously that is not the case.
This behavior did not occur in the previous version (5.0.?).
Output with option --verbose:
dotnet exec --depsfile D:\Source\Workspaces\Test\DbNQCore\DbNQCore\bin\Debug\net5.0\DbNQCore.deps.json --additionalprobingpath C:\Users\rbenjes\.nuget\packages --additionalprobingpath "C:\Program Files\dotnet\sdk\NuGetFallbackFolder" C:\Users\rbenjes\.dotnet\tools\.store\dotnet-ef\6.0.0-preview.1.21102.2\dotnet-ef\6.0.0-preview.1.21102.2\tools\netcoreapp3.1\any\tools\netcoreapp2.0\any\ef.dll dbcontext scaffold connection Microsoft.EntityFrameworkCore.SqlServer --assembly D:\Source\Workspaces\Test\DbNQCore\DbNQCore\bin\Debug\net5.0\DbNQCore.dll --startup-assembly D:\Source\Workspaces\Test\DbNQCore\DbNQCore\bin\Debug\net5.0\DbNQCore.dll --project-dir D:\Source\Workspaces\Test\DbNQCore\DbNQCore\ --language C# --working-dir D:\Source\Workspaces\Test\DbNQCore\DbNQCore --verbose --root-namespace DbNQCore Microsoft.EntityFrameworkCore.Tools.CommandException: Missing required argument '<PROVIDER>'. at Microsoft.EntityFrameworkCore.Tools.Commands.DbContextScaffoldCommand.Validate() at Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.<>c__DisplayClass0_0.<Configure>b__0(String[] args) at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args) Missing required argument '<PROVIDER>'.
The text was updated successfully, but these errors were encountered: