1
我正在学习如何使用实体框架网站实体框架迁移的ArgumentException
建立数据库模型后,我可以很容易地进行Web应用程序和控制台项目迁移。
但是,当我在一个网站项目中创建一个数据库模型和执行迁移,控制台提示我
System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
Server stack trace:
at EnvDTE.Properties.Item(Object index)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at EnvDTE.Properties.Item(Object index)
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName)
at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName)
at System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName)
at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
我能做些什么呢? Q2。如果我创建一个Web应用程序项目,我该如何部署它?除FTP之外,我不知道任何其他方式来部署网站。
Q1。你如何运行你的迁移? Q2。看看web部署http://msdn.microsoft.com/en-us/library/dd465337.aspx – Thewads 2013-04-22 09:41:25
我只是键入enable-migrations。就这样。 我不知道我应该为其他参数 – 2013-04-22 10:30:44
我有这个确切的问题。使用Web应用程序和控制台应用程序中的“Enable-Migrations”,Entity Framework可以正常工作。但是,当试图在网站项目中使用它时,我会收到错误消息,而且我找不到任何帮助(主要是人们说要将项目名称传入命令,但这也不起作用) – Ant 2013-06-04 21:08:40