NullReferenceException adding nuget with packageref in C++ project #4378

Closed
ridomin opened this Issue Jan 23, 2017 · 0 comments

Comments

Projects
None yet
4 participants
@ridomin

ridomin commented Jan 23, 2017

Details about Problem

Using VS 2017 RC (D15rel 26119.0)
Package Manager Console Host Version 4.0.0.2215

Detailed repro steps so we can see the same problem

  1. Create a new UWP CPP project)

  2. Add Reference to any NuGet (eg. MvvmLight)

  3. Select PackageReference

Expected. NuGet added to the project

Observed: NullReferenceException

Verbose Logs

System.NullReferenceException: Object reference not set to an instance of an object.
   at NuGet.PackageManagement.VisualStudio.EnvDTEProjectAdapter.<GetLegacyCSProjPackageReferences>d__38.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at NuGet.PackageManagement.VisualStudio.LegacyCSProjPackageReferenceProject.GetPackageSpec()
   at NuGet.PackageManagement.VisualStudio.LegacyCSProjPackageReferenceProject.<>c__DisplayClass36_0`1.<<RunOnUIThread>b__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.<JoinAsync>d__76.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.LegacyCSProjPackageReferenceProject.<RunOnUIThread>d__36`1.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.LegacyCSProjPackageReferenceProject.<GetPackageSpecAsync>d__30.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.LegacyCSProjPackageReferenceProject.<GetInstalledPackagesAsync>d__21.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.UI.DetailControlModel.<GetDependencies>d__17.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.UI.DetailControlModel.<<get_InstalledPackageDependencies>b__16_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 Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod, JoinableTaskCreationOptions creationOptions)
   at NuGet.PackageManagement.UI.DetailControlModel.get_InstalledPackageDependencies()
   at NuGet.PackageManagement.UI.PackageDetailControlModel.UpdateInstalledVersion()
   at NuGet.PackageManagement.UI.PackageDetailControlModel.NuGetProjectChanged(Object sender, NuGetProjectEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at NuGet.PackageManagement.VisualStudio.VSSolutionManager.<UpdateNuGetProjectToPackageRef>d__57.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.UI.NuGetUI.<UpdateNuGetProjectToPackageRef>d__9.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.UI.UIActionEngine.<CheckPackageManagementFormat>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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at NuGet.PackageManagement.UI.UIActionEngine.<PerformActionImplAsync>d__7.MoveNext()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment