[VSFeedback] Error occurred while restoring NuGet packages for website project: Value cannot be null. #4092

Closed
rrelyea opened this Issue Dec 12, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@rrelyea
Contributor

rrelyea commented Dec 12, 2016

[Feedback] Error occurred while restoring NuGet packages: Value cannot be null.
Internal Bug 293947

Perhaps MsBuildNuGetProject.cs ~ line 609

        public async Task<IReadOnlyList> GetPackageSpecsAsync(DependencyGraphCacheContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            PackageSpec packageSpec = null;
            if (!context.PackageSpecCache.TryGetValue(MSBuildNuGetProjectSystem.ProjectFileFullPath, out packageSpec))

ProjectFileFullPath may be null? Not sure what would cause that.
One clue...the project file guid is the one for solution folders...???

Stack trace from the vsfeedback item:
Error occurred while restoring NuGet packages: System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at System.Collections.Generic.Dictionary2.FindEntry(TKey key)    at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
   at NuGet.ProjectManagement.MSBuildNuGetProject.d__41.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 NuGet.PackageManagement.DependencyGraphRestoreUtility.d__8.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 NuGet.PackageManagement.DependencyGraphRestoreUtility.d__6.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 NuGet.PackageManagement.VisualStudio.SolutionRestoreJob.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 NuGet.PackageManagement.VisualStudio.SolutionRestoreJob.d__20.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 NuGet.PackageManagement.VisualStudio.SolutionRestoreJob.d__19.MoveNext()

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Dec 12, 2016

Contributor

Likely repro steps (via an email thread):

  1. File New Web Site (C#, Empty)
  2. Add New Project (C#, Asp.Net Core, WebApp)

At this point,

  1. try opening a .cshtml file  lots of errors
  2. try solution level restore  following error in output window: “Error occurred while restoring NuGet packages: Value cannot be null. Parameter name: key”
Contributor

rrelyea commented Dec 12, 2016

Likely repro steps (via an email thread):

  1. File New Web Site (C#, Empty)
  2. Add New Project (C#, Asp.Net Core, WebApp)

At this point,

  1. try opening a .cshtml file  lots of errors
  2. try solution level restore  following error in output window: “Error occurred while restoring NuGet packages: Value cannot be null. Parameter name: key”

@zhili1208 zhili1208 changed the title from [VSFeedback] Error occurred while restoring NuGet packages: Value cannot be null. to [VSFeedback] Error occurred while restoring NuGet packages for website project: Value cannot be null. Dec 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment