[英]Unable to find NuGet packages despite packages being installed NU1101
I created my first C# application recently, and since buying a new computer I cannot get the application to start.我最近创建了我的第一个 C# 应用程序,并且由于购买了一台新计算机,我无法启动该应用程序。 I am receiving 7 of the following errors
Error NU1101 Unable to find package Microsoft.VisualStudio.Web.CodeGeneration.Design. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages clesson C:\Users\porkh\Desktop\WERK\Personal\c-lesson\clesson\clesson\clesson.csproj
我收到以下 7 个错误
Error NU1101 Unable to find package Microsoft.VisualStudio.Web.CodeGeneration.Design. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages clesson C:\Users\porkh\Desktop\WERK\Personal\c-lesson\clesson\clesson\clesson.csproj
Error NU1101 Unable to find package Microsoft.VisualStudio.Web.CodeGeneration.Design. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages clesson C:\Users\porkh\Desktop\WERK\Personal\c-lesson\clesson\clesson\clesson.csproj
Each with different packages missing. Error NU1101 Unable to find package Microsoft.VisualStudio.Web.CodeGeneration.Design. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages clesson C:\Users\porkh\Desktop\WERK\Personal\c-lesson\clesson\clesson\clesson.csproj
每个都缺少不同的包。
Since this was a missing dependencies message I reinstalled visual studio 2019 with C# .net support again, yet I am running into the same error.由于这是缺少依赖项消息,我重新安装了带有 C# .net 支持的 Visual Studio 2019,但我遇到了同样的错误。
On StackOverFlow I read that I need to check my NuGet packages,在 StackOverFlow 上,我读到我需要检查我的 NuGet 包,
Here it shows every package that is "missing" in the error messages as installed.在这里,它显示了安装时错误消息中“缺失”的每个 package。
I have also tried running dotnet run
and dotnet restore
but I get the same error messages.我也尝试过运行
dotnet run
和dotnet restore
但我收到相同的错误消息。 I am extremely new to C# so sorry if I have missed the solution in other's answers.我对 C# 非常陌生,如果我错过了其他答案中的解决方案,我很抱歉。 Any help you can give me I'd appreciate it.
您可以给我的任何帮助我将不胜感激。
A link to all of my project files here我的所有项目文件的链接在这里
In the image it says在图片中它说
Not available in this source
此来源中不可用
and the package source is set to Offline Packages.并且 package 源设置为离线包。 My best guess is, switching to an official NuGet Feed in the drop down to the upper right, will solve your problem.
我最好的猜测是,在右上角的下拉菜单中切换到官方 NuGet Feed 将解决您的问题。 You also want to check, if the Nuget source is available (it should).
您还想检查 Nuget 源是否可用(应该)。 If not, click the Cog icon, and add it there with the name "Nuget" and the Url
https://api.nuget.org/v3/index.json
If not, click the Cog icon, and add it there with the name "Nuget" and the Url
https://api.nuget.org/v3/index.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.