I am creating a new application at work. In the past we have always used reverse poco to generate entity models, this is my first time trying to do it with EF. I am setting up my new data layer and trying to create a db context and the models needed. I am doing this in a class library that is currently a stand alone project. I am using the same connection string that our older application uses (copy pasted into the -Connection section of the below command).
I have installed the following packages
Microsoft.EntityFrameworkCore (8.0.7)
Microsoft.EntityFrameworkCore.Design (8.0.7)
Microsoft.EntityFrameworkCore.SqlServer (8.0.7)
Microsoft.EntityFrameworkCore.Tools (8.0.7)
In the Package manager console I using this command
Scaffold-DbContext -Connection "Data Source=svr-cm-servernamehere;Initial Catalog=DbNameHere;Persist Security Info=True;User ID=aUserId;Password=aPassword;MultipleActiveResultSets=True"
-Provider Microsoft.EntityFrameworkCore.SqlServer
-OutputDir Models -Context NameHereDbContext
I get the following error:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The target principal name is incorrect.)
I noticed if I log into SSMS with the connection strings credentials that I could not query the database in question. I added the user to the database and granted all permissions. I can now query the database under that account but the command is giving the same error.