Error while running Enable-Migrations in Visual studio 2017


I am trying to migrate my web app from membership to ASP.Net Identity by following this tutorial. But I get this error when I execute the Enable-migrations command:

Blockquote PM> Enable-migrations System.ArgumentException: Paramètre incorrect. (Exception de HRESULT : 0x80070057 (E_INVALIDARG))

Server stack trace: à EnvDTE.Properties.Item(Object index) à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: à System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) à System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) à EnvDTE.Properties.Item(Object index) à System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName) à System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory) à System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName) à System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0() à System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) Paramètre incorrect. (Exception de HRESULT : 0x80070057 (E_INVALIDARG))

I tried with the parameters -ProjectName and -StartUpProjectName but it does not work. I use EntityFramework 6.2.0. Need help please.
asked on Stack Overflow Oct 24, 2018 by kst92

1 Answer


For those who are interested, I finally created a library a c# in my project (select your project then file-> new project-> visual c# -> class library). I made the migrations in this library and I added it as a reference to my project and it worked.

answered on Stack Overflow Nov 5, 2018 by kst92

User contributions licensed under CC BY-SA 3.0