当每次需要添加迁移或更新数据库时使用EF 4.3.1迁移时,我必须使用StartUpProject参数。我可以设置这个地方,所以我不必继续这样做吗?我不想将我的数据项目设置为启动项目。如果情况有所改变,我的环境和迁移将处于不同的项目中。为实体框架迁移设置启动项目参数
不使用StartpProject参数时抛出异常:
update-database -verbose
Using NuGet project 'Data.Deployment'.
Using StartUp project ''.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Management.Automation.ComMethod.InvokeMethod(PSMethod method, Object[] arguments)
Exception has been thrown by the target of an invocation.
我已经做到了,但如果我不指定ŧ他StartupProject参数引发异常 –
认真?你能发布异常的整个输出吗? –
在 –