Issues with Updating database after migration

Adeleke

New member
Joined
Mar 13, 2021
Messages
1
Programming Experience
1-3
I am facing issues with Updating my dB using : dotnet ef database update.

It returns this error message after I run the command above :
System.ArgumentException : Connection string keyword 'server' is not supported
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
2,892
Location
Chesapeake, VA
Programming Experience
10+
Grain of salt here: I don't use EF, and usually recommend people avoid EF.

Anyway, the error seems pretty self explanatory. If EF does not support the "Server" keyword in the connection string, then don't use "Server". Since this is a database upgrade, presumably you are using Code First EF, and so the first connection string you used when the database was first created did not use the "Server" keyword. If that assumption is correct and EF were self-consistent from creation to upgrade, then someone must have introduced that "Server" keyword later. Ask whoever added/modified to connection string to deal with the upgrade problem. (Granted, one of the reasons why I don't use EF is because I kept on hitting bugs in EF, as well as there were places where it was not self consistent.)
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,720
Location
Sydney, Australia
Programming Experience
10+
Don't assume that we can read your mind. You haven't told us what database or shown us your connection string. I'm going to guess SQL Server but I might be wrong. SQL Server supports the "Server" and "Database" keywords as well as the "Data Source" and "Initial Catalog" keywords. I would think that EF would too but I always use the latter and never have issues so you might try that instead.
 
Top Bottom