Reputation: 29
I'm facing an issue when trying to generate Entity Framework Core models from an Azure SQL Database using the dotnet ef dbcontext scaffold command.
Server=[server name].database.windows.net;Database=[database name];User ID=[username];Password=\"[password]\";Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
dotnet ef dbcontext scaffold "Server=[server name].database.windows.net;Database=[database name];User ID=[username];Password=\"[password]\";Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -o . --context-dir .
The words in [blocks] are filled with the correct private info.
When I run the command above, the console says:
Build started...
Build failed. Use dotnet build to see the errors.
When I run dotnet build
, I get no errors, just 24 warnings
Checked for build errors using dotnet build
, but there are none.
Adjusted the connection string and folder paths, but the issue persists.
Connected to server using server address, username and password with sql server management studio and with sql server object explorer in Visual Studio
Upvotes: 1
Views: 271
Reputation: 29
I was in the wrong directory, huge difference between "C:\Users\Nick\source\repos\Project Name" and "C:\Users\Nick\source\repos\Project Name\Project Name"
Upvotes: 0
Reputation: 203
Looks like 6.0.400 is an SDK version from August 2022
I would start by making sure you have the latest runtime and SDK for .NET 6
Upvotes: -1