I am using .net 6 and EntityFrameworkCore Version 6.0.8. I made a migration and tried to update database with updata-database command in Package manager console but the following exception is thrown: System.ArgumentException: Keyword not supported: 'server:(localdb)\mssqllocaldb;database'. This is my connection string in the appsettings file: "Server=(LocalDB)\MSSQLLocalDB;Database=Bulky;Trusted_Connection=True;"
and this is my program.cs file:
What might be the problem?
CodePudding user response:
According to the error, the connection string returned from your configuration is messed up, and looks something like
"server:(localdb)\mssqllocaldb;database= . . ."
Which parses all of server:(localdb)\mssqllocaldb;database
as a single Keyword.
.NET Core configuration can load from multiple locations, so your appSettings.json may not be the source of the configuration value.