This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18548|Reply: 0

[.NET Core] efcore Add-Migration error

[Copy link]
Posted on 11/15/2019 2:27:13 PM | | |
Question 1: Add-Migration: An exception occurs when calling "AddFromFile" with "1" parameter: "basePath" cannot be an empty string ("") or start with a null character.
Parameter name: basePath"
Location Line: 1 Characters: 1




1. Install .netCore

2. Close the console and restart VS

3. Check for spaces: More or fewer spaces Occasionally, this problem can occur.

Issue 2: The Add-Migration item cannot be recognized as the name of a cmdlet, function, script file, or executable program. Please check the spelling of the name and if you include a path, make sure it is correct and try again.

1. Cite EFCore.sql, EFCore, EFCore.Design.

Question 3: No migrations configuration type was found in the assembly 'Nop.Data'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

1. Run Enable-Migrations – EnableAutomaticMigrations


Common commands:

add-Migration -c TextContext  initDb

update-Database -c TextContext





Previous:C# connects sqlserver to two types of connection strings for windows and sqlserver authentication
Next:HasValue in C# determines whether a nullable type has a value
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com