Link to home
Start Free TrialLog in
Avatar of Babak Sekandari
Babak SekandariFlag for United States of America

asked on

For .NET Core Database-First scaffolding, how do I get the server connection ?

Hi,
I have an ASP.NET MVC Core 2.1.1 project running in Visual Studio 2019.
Since I have already created a database, I want to connect the application to the existing database with database-first development.
From the Visual Studio, Package Manager Console, I put in:

Scaffold-DbContext "server=ServerName;Database=DbName; Trusted_Connection=true; Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

That gives me the following error:
The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.8-servicing-32085'. Update the tools for the latest features and bug fixes.
Unable to find provider assembly with name server=ServerName. Ensure the specified name is correct and is referenced by the project.

I got the name, ServerName, directly from the Visual Studio connection properties:
Data Source=ServerName; Initial Catalog=DbName; Integrated Security=True

Is there something different I should put for ServerName?
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial