當每次需要添加遷移或更新數據庫時使用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參數引發異常 –
認真?你能發佈異常的整個輸出嗎? –
在 –