我在 Visual Studio 2019 (Targeting .NET 5.0) 中創建了一個新的 MVC Web App 專案
現在我想安裝 EntityFrameworkCore,但是當我在 NuGet 管理器中搜索時它沒有出現在串列中。如果我輸入“物體”,只會出現 3 個選項。如果我輸入更多,則不會出現更多內容。

我也嘗試打字(在控制臺管理器中)
Install-Package Microsoft.EntityFrameworkCore -Version 5.0.11
并收到此錯誤:
`Install-Package : NU1101: Unable to find package`
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packag
es
At line:1 char:1
Install-Package Microsoft.EntityFrameworkCore -Version 5.0.11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (:) [Install-Package], Exception
FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
我也多次嘗試清理和構建專案。我最近剛安裝的VS2019。可能有什么問題?
uj5u.com熱心網友回復:
在 Visual Studio 中轉到Tools ? Options。選擇NuGet Package Manager。檢查您Package sources:是否包含nuget.org設定為https://api.nuget.org/v3/index.json:

然后Tools? NuGet Package Manager? Manage NuGet Packages for Solution...。打開Browse選項卡。
在組合框中選擇nuget.orgPackage source::

轉載請註明出處,本文鏈接:https://www.uj5u.com/net/317460.html
標籤:asp.net-mvc 视觉工作室 实体框架 asp.net核心 视觉工作室-2019
上一篇:WPF之資源專題
