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

View: 28491|Reply: 4

[Source] ef Perform the Add-Migration error resolution

[Copy link]
Posted on 7/5/2018 4:24:26 PM | | | |
Your startup project 'XXX' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.




When executing a command, there is a yellow prompt at the bottom, as follows:

Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework Core tools are running. Use 'EntityFramework\Add-Migration' for Entity Framework 6.
Both Entity Framework Core and Entity Framework 6 are installed. The Entity Framework core tools are running. Use "EntityFramework\Add-Migration" for Entity Framework 6.

Solution:



Both Entity Framework 6.x and Entity Framework Core commands are installed. The Entity Framework 6 version is executing. You can fully qualify the command to select which one to execute, 'EntityFramework\Add-Migration' for EF6.x and 'EntityFrameworkCore\Add-Migration' for EF Core.

Entity Framework 6.x and Entity Framework Core commands are installed. Entity Framework 6 version is being executed. You can fully qualify commands to choose which commands to execute, "EntityFramework\Add-Migration" for EF6.x and "EntityFrameworkCore\Add-Migration" for EF Core.




Previous:Ask for help from the campus academic management system password recovery
Next:404 pages for pure HTML5 CSS3 implementation
 Landlord| Posted on 2/13/2019 1:08:46 PM |
If you want to get detailed help information for PowerShell commands, such as Enable-Migration, you only need to enter itGet-Help Enable-Migrations, and other commands are followed by analogy.

For more information, please refer to Microsoft's official documentation:The hyperlink login is visible.
Posted on 2/13/2019 1:19:31 PM |
mark
 Landlord| Posted on 6/21/2023 10:39:28 PM |
VS 2022 will give an error when executing the migration command, which is normal when using VS 2019.

PM> EntityFramework\Add-Migration test
Both Entity Framework 6.x and Entity Framework Core commands are installed. The Entity Framework 6 version is executing. You can fully qualify the command to select which one to execute, 'EntityFramework\Add-Migration' for EF6.x and 'EntityFrameworkCore\Add-Migration' for EF Core.
System.ArgumentNullException: 值不能为 null。
Parameter name: type
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project, Int32 shellVersion)
   In System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
   In System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
   In System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
   In System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name, Boolean force, Boolean ignoreChanges)
   In System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
The value cannot be null.
Parameter name: type

 Landlord| Posted on 7/14/2023 8:55:15 PM |
Xiao Zhazha Posted on 2023-6-21 22:39
VS 2022 will give an error when executing the migration command, which is normal when using VS 2019.

PM> EntityFramework\Add-Migration test


VS 2022 Solution

Unable to load module "EntityFramework". For more information, run Import-Module EntityFramework


Upgrade to EntityFramework.6.4.4 and run the following command:

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