How to fix restoring nuget packages error?

1

After a couple of weeks I revisited my .NET C# project in Visual Studio 2010. I changed just one line in source code and tried to rebuild the project and I get this error:

Error occurred while restoring NuGet packages: could not be found. (Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND))

I don't have the slightest clue why this error appeared. Nothing was changed, somehow this nuget got corrupted. I have done a lot of searching via google but found nothing that would get me on the right track.

is it possible to remove nuget all together, because it is nothing but a cause of grief?

c#
visual-studio-2010
nuget
nuget-package
nuget-package-restore
asked on Stack Overflow Nov 5, 2015 by f470071 • edited Nov 20, 2015 by meagar

2 Answers

6

I've faced with the same issue: I solved this problem by going to Tools -> Options -> Projects and Solutions -> Build and Run and clicking on OK

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

I also had this call stack:

    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()
answered on Stack Overflow Jun 30, 2020 by Alexey Ryazhskikh
-1

If you right click your solution in Visual Studio. Do you see any option called "Enable NuGet Package Restore"?

If yes, try to click on it and rebuild again.

answered on Stack Overflow Nov 5, 2015 by an1s

User contributions licensed under CC BY-SA 3.0