简体   繁体   English

Visual Studio 2022 项目依赖项 NuGetPackages 不会加载

[英]Visual Studio 2022 Project dependencies NuGetPackages won't load

在此处输入图片说明

Everything was working until I cleaned one project and then the NuGetPackages won't load.一切正常,直到我清理了一个项目,然后 NuGetPackages 将无法加载。 I've tried to clean the solution and all projects.我试图清理解决方案和所有项目。 I've also tried to build, rebuild, unload, load the projects.我还尝试构建、重建、卸载、加载项目。 Then I removed .vs folder and restarted VS but noting worked.然后我删除了 .vs 文件夹并重新启动了 VS 但注意到工作。 Then I repaired VS and still nothing worked.然后我修复了 VS,但仍然没有任何效果。

I'm using VS 2022 17.0.0 Preview 4.1我正在使用 VS 2022 17.0.0 预览版 4.1

Check that your package sources are setup correctly.检查您的包源设置是否正确。 I noticed that after installing VS 2022 RC3 (maybe before that, but didn't notice until today) that my package sources had all been deleted.我注意到在安装 VS 2022 RC3 之后(可能在此之前,但直到今天才注意到)我的包源已全部删除。

  1. Tools->Options工具->选项
  2. Nuget Package Manger->Package Sources Nuget 包管理器->包源
  3. Check for a source that points to: https://api.nuget.org/v3/index.json检查指向的来源: https : //api.nuget.org/v3/index.json

If its not there, add one by clicking the "+" button near top right.如果没有,请单击右上角附近的“+”按钮添加一个。 Then update the "Name" and "Source" fields at the bottom, then click the "Update" button in the bottom right.然后更新底部的“名称”和“来源”字段,然后单击右下角的“更新”按钮。

Screen Shot of Package Sources包源的屏幕截图

安装 VS2022 RC 后我得到相同的结果:/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM