add-migration InitialMigration和update-database都出現(xiàn)同樣的結(jié)果
求問(wèn)各位大神為什么會(huì)出現(xiàn)如圖問(wèn)題???
已經(jīng)安裝了Microsoft.EntityFramework / Microsoft.EntityFramework.Tools / Microsoft.EntityFramework.SqlServer
求問(wèn)各位大神為什么會(huì)出現(xiàn)如圖問(wèn)題???
已經(jīng)安裝了Microsoft.EntityFramework / Microsoft.EntityFramework.Tools / Microsoft.EntityFramework.SqlServer
舉報(bào)
2020-05-07
hello 同學(xué)好啊,問(wèn)題解決了嗎?這是個(gè)比較少見(jiàn)的問(wèn)題。搜了一下網(wǎng)上的答案,發(fā)現(xiàn)類(lèi)似的問(wèn)題,https://github.com/dotnet/efcore/issues/16386?
帖主也出現(xiàn)了同樣的問(wèn)題,后來(lái)他卸載了visual studio 的 Azure developmen組件,就解決了。后來(lái)也有人回復(fù)說(shuō)碰上同樣的問(wèn)題,用vs 2019就報(bào)錯(cuò),用vs 2017就可以。后來(lái)還有個(gè)人說(shuō),他的電腦是惠普的,在他電腦上運(yùn)行就不行,拿到別人的電腦就可以。。。??傊?,這個(gè)問(wèn)題似乎有很多人都碰到過(guò)。
然后我看了,他們的解決方式,感覺(jué)都不太靠譜。
不過(guò)有兩個(gè)人的解決方式值得參考一下,他們說(shuō)vs 2019不行,但是vs 2017就可以,所以我在想或許真的是visual studio所導(dǎo)致的問(wèn)題。
所以,你可以做一下兩個(gè)嘗試
下載個(gè)vs 2017試試看。
使用 dotnet cli(命令行)代替使用 package-manage-console
)打開(kāi)命令行,全局安裝 dotnet-ef: dotnet tool install --global dotnet-e
)關(guān)閉命令行,重新打開(kāi),cd進(jìn)入項(xiàng)目文件夾
)輸入dotnet ef命令:dotnet ef migrations add InitialMigration
)如果成功,繼續(xù)輸入命令:dotnet ef database update
2020-04-15
確實(shí)有點(diǎn)奇怪,試試下載課程的源碼試試看:https://github.com/Yaduo/LanzhouBeefNoodles,如果還有問(wèn)題,留言下來(lái),我再看看
2020-07-22
https://cloud.tencent.com/developer/ask/222513
這個(gè)帖子給了一個(gè)解決方案:
嘗試將此添加到.csproj文件中
我使用的這個(gè)方法解決的問(wèn)題
2020-04-16
換到3.1之后報(bào)錯(cuò)
PM> add-migration InitialMigration
Build started...
Build succeeded.
System.IO.FileLoadException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
? ?at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
? ?at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
? ?at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
? ?at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
2020-04-14
把Project.dll也復(fù)制過(guò)去之后報(bào)錯(cuò)
Your startup project 'project' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.
令人頭禿?已經(jīng)安裝了一下這些?還是不行
2020-04-14
之前錯(cuò)誤顯示不全是因?yàn)槁窂接兄形?..改成英文之后報(bào)錯(cuò)是
PM> add-migration InitialMigration
The specified deps.json [F:\project\project.deps.json] does not exist
我的該文件在F:\project\bin\Debug\netcoreapp2.2里面?試著把他復(fù)制到F:\project之后報(bào)錯(cuò)為
Error:
? An assembly specified in the application dependencies manifest (project.deps.json) was not found:
? ? package: 'project', version: '1.0.0'
? ? path: 'project.dll'
誰(shuí)來(lái)救救孩子...