efcore Add-Migration Error Solved (Three Errors to Solved)

Error 1: add migration: an exception occurred when calling “addfromfile” with “1” arguments: “basepath” cannot be an empty string (“) or start with a null character

Parameter name: basepath ”
location line: 1 character: 1
+ add migration” log ”
+ ~ ~ ~ ~ ~ ~ ~
+ categoryinfo: notspecified: (:) [add migration], methodinvocationexception
+ fullyqualified errorid: argumentexception, add migration

1. Install. NETCORE

2. Close the console and restart vs

3. Check the space: more space or less space will occasionally have this problem

Error 2: the “add migration” item cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name. If the path is included, make sure the path is correct, and then try again

 

 

Error 3: no migrations configuration type was found in the assembly ‘NOP. Data’

1. Execute enable migrations – enable automatic migrations

Common commands:

add-Migration -c TextContext initDb

update-Database -c TextContext

Similar Posts: