在具有遷移的ASP.NET Core應用程序中,運行更新數據庫會提供以下輸出。它可以工作,詳細輸出顯示各種選項的默認值。dotnet ef命令的期望值有哪些規則?
dotnet ef --verbose database update
Setting the data directory to 'C:\temp\bin\Debug\netcoreapp1.0\'.
Invoking dependency command 'Microsoft.EntityFrameworkCore.Design' in project '2016-101DP-TreeGame-Auth'
Running C:\Program Files\dotnet\dotnet.exe exec
--runtimeconfig C:\temp\bin\Debug\netcoreapp1.0\temp.runtimeconfig.json
--depsfile C:\temp\bin\Debug\netcoreapp1.0\temp.deps.json
--additionalprobingpath C:\Users\me\.nuget\packages C:\Users\me\.nuget\packages\Microsoft.EntityFrameworkCore.Design\1.0.0-preview2-final\lib\netcoreapp1.0\Microsoft.EntityFrameworkCore.Design.dll
--assembly C:\temp\bin\Debug\netcoreapp1.0\temp.dll
--startup-assembly C:\temp\bin\Debug\netcoreapp1.0\temp.dll
--dispatcher-version 1.0.0-preview2-21431
--data-dir C:\temp\bin\Debug\netcoreapp1.0\
--project-dir C:\temp
--content-root-path C:\temp
--root-namespace temp
--verbose update database
Process ID: 12544
Finding DbContext classes...
Using context 'ApplicationDbContext'.
Done.
當我嘗試使用選項運行相同的命令時,CLI會抱怨我的選項有「意外的值」。這裏有兩個例子。
dotnet ef --data-dir C:\temp\bin\Debug\netcoreapp1.0\ --verbose database update
dotnet ef --data-dir "C:\temp\bin\Debug\netcoreapp1.0\" --verbose database update
兩個告訴我:
Microsoft.Extensions.CommandLineUtils.CommandParsingException:意外的值 'C:\ TEMP \ BIN \調試\ netcoreapp1.0 \' 選項 '數據目錄'
在Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(字串[] args)
在Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(字串[] args)
對於dotnet ef
命令的期望值有哪些規則?