【问题标题】:How to fix restoring nuget packages error?如何修复恢复 nuget 包错误?
【发布时间】:2015-11-05 12:46:49
【问题描述】:

几周后,我在 Visual Studio 2010 中重新访问了我的 .NET C# 项目。我只更改了源代码中的一行并尝试重新构建项目,但出现以下错误:

还原 NuGet 包时出错:找不到。 (来自 HRESULT 的异常:0x80030002 (STG_E_FILENOTFOUND))

我不知道为什么会出现此错误。什么都没有改变,不知何故这个nuget被破坏了。 我通过 google 进行了很多搜索,但没有找到任何能让我走上正轨的东西。

是否可以一起删除 nuget,因为它只是一个悲伤的原因?

【问题讨论】:

    标签: c# visual-studio-2010 nuget nuget-package nuget-package-restore


    【解决方案1】:

    我也遇到过同样的问题: 我通过转到工具 -> 选项 -> 项目和解决方案 -> 构建和运行并单击确定解决了这个问题

    来源: https://developercommunity.visualstudio.com/content/problem/1015106/exception-occurred-exception-from-hresult-0x800200.html

    我也有这个调用堆栈:

        System.Runtime.InteropServices.COMException (0x80020009): Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))
        at EnvDTE.Property.get_Value()
        at NuGetVSExtension.OutputConsoleLogger.<GetMSBuildVerbosityLevelAsync>d__23.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at NuGetVSExtension.OutputConsoleLogger.<<Start>b__24_0>d.MoveNext()
        --- End of stack trace from previous location where exception was thrown ---
        at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
        at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
        at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
        at NuGetVSExtension.OutputConsoleLogger.Start()
        at NuGet.PackageManagement.UI.NuGetUI.BeginOperation()
        at NuGet.PackageManagement.UI.UIActionEngine.<>c__DisplayClass12_0.<<PerformActionImplAsync>b__0>d.MoveNext()
    

    【讨论】:

      【解决方案2】:

      如果您在 Visual Studio 中右键单击您的解决方案。您是否看到任何名为“启用 NuGet 包还原”的选项?

      如果是,请尝试单击它并重新构建。

      【讨论】:

      • 嗯,是的。但我害怕使用它。与 nuget 相关的一切都让我变得非常多样化,因为大多数情况下它最终都以损坏的项目或 unnned 导入和很多麻烦而告终。我希望有办法消除 nuget。
      • 我试过了。就像我害怕一样。现在它没有显示任何错误。它只是不建立。没有什么帮助,清理,构建,重建......什么都没有。,
      • 尝试清除您的 nuget 包缓存。在 Visual Studio 中,转到工具 -> 选项 -> Nuget 包管理器 -> 常规,然后选择浏览按钮。删除缓存。
      • 同时删除 [SOLUTION PATH]\packages 文件夹的内容。这将确保根据您的 packages.config 从 NuGet 下载正确的包。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多