Entity Code First Migrations does not find Microsoft.EntityFrameworkCore.Design

Asked

Viewed 133 times

1

Hello, I am working on a dotnet 4.5.1 project using Entityframework with Codefirst Migrations, I have added 1 new field to an entity and I am trying to add a new Migration, but the following error message is displayed:

N�o foi poss�vel carregar arquivo ou assembly 'Microsoft.EntityFrameworkCore.Design' ou uma de suas depend�ncias. O sistema n�o pode encontrar o arquivo especificado

The command I used was this one:

Add-Migration AddPaymentDataToQuote -project [nome do meu projeto]

I have tried to reinstall the package, rebuilding the Solution, but without success.

This is the complete message after running the above command

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.
System.IO.FileNotFoundException: N�o foi poss�vel carregar arquivo ou assembly 'Microsoft.EntityFrameworkCore.Design' ou uma de suas depend�ncias. O sistema n�o pode encontrar o arquivo especificado.
Nome do arquivo: 'Microsoft.EntityFrameworkCore.Design'
   em System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   em System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   em System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   em System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   em System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   em System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   em System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   em Microsoft.EntityFrameworkCore.Tools.AppDomainOperationExecutor..ctor(String assembly, String startupAssembly, String projectDir, String contentRootPath, String dataDirectory, String rootNamespace, String environment)
   em Microsoft.EntityFrameworkCore.Tools.Commands.ProjectCommandBase.CreateExecutor()
   em Microsoft.EntityFrameworkCore.Tools.Commands.MigrationsAddCommand.Execute()
   em Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
   em Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)

AVI: o log de associa��es de assembly est� desativado.
Para ativar o log de  falhas de assembly, defina o valor do Registro [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1.
Observa��o: h� alguma penalidade para o desempenho associada ao log de falha de associa��o de assembly.
Para desativar esse recurso, remova o valor do Registro [HKLM\Software\Microsoft\Fusion!EnableLog].
  • just a hint, assuming that Migrations is already enabled in your project, when you open the Package Manager console, has the option Default project, ai you can choose the project you are using codefirst and the Entity framework installed, and pass only Add-Migration AddPaymentDataToQuote

  • Opa valeu brother.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.