Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing required argument '<PROVIDER>'. Scafffold Dbcontext in asp.net core 2.1.MAC

Trying to do Scaffold with the existing database in mac os visual studio using terminal.

Here is the command for the scaffold

dotnet ef dbcontext Scaffold "Server=<servername>;Initial Catalog=<dbName>;Persist Security Info=False;User ID=<rental>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"Microsoft.EntityFrameworkCore.SqlServer -o Model

dependencies

error details

But keep getting an error as Missing required argument ''.

https://learn.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet

https://www.learnentityframeworkcore.com/walkthroughs/existing-database

like image 581
San Jaisy Avatar asked Aug 05 '18 11:08

San Jaisy


People also ask

What is scaffold DbContext command?

The above Scaffold-DbContext command creates entity classes for each table in the SchoolDB database and context class (by deriving DbContext ) with Fluent API configurations for all the entities in the Models folder. The following is the generated Student entity class for the Student table.

How to update EF Core tools version?

Update the toolsUse dotnet tool update --global dotnet-ef to update the global tools to the latest available version. If you have the tools installed locally in your project use dotnet tool update dotnet-ef . Install a specific version by appending --version <VERSION> to your command.


1 Answers

You are missing a space between the connection string and the provider type:

dotnet ef dbcontext scaffold
    "Server=<servername>;…Timeout=30;"Microsoft.EntityFrameworkCore.SqlServer -o Model

                                     ↑↑

So you are only passing a single argument to the command, making the provider name missing.

like image 54
poke Avatar answered Oct 18 '22 20:10

poke