0
votes

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.

1
What does your solution structure look like? Are your classes for your models separated into a different project than the web app? - user1011627
@user1011627, all my classes are in the same project - kst92
Can you show the actual commands you are attempting to run? - user1011627
Also, do you have a "globalization" section in web.config for the project? - user1011627
enable-migrations -ProjectName myApp and enable-migrations -StartUpProjectName myApp. myApp is the name of the project. - kst92

1 Answers

0
votes

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.