如何修复还原nuget包错误

本文关键字:错误 包错误 何修复 还原 nuget | 更新日期: 2023-09-27 18:20:44

几周后,我重新访问了Visual Studio 2010中的.NET C#项目。我只修改了源代码中的一行,并试图重建项目,但我得到了这个错误:

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

我根本不知道为什么会出现这个错误。什么都没有改变,不知怎么的,这个裸体被破坏了。我通过谷歌搜索了很多,但没有找到能让我走上正轨的东西。

有没有可能把裸体放在一起,因为这只会引起悲伤?

如何修复还原nuget包错误

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

来源: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()

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

如果是,请尝试单击它并重新生成。