Migration Throws "Object reference Exception" in NuGet.PackageManagement.VisualStudio.SolutionRestoreWorker #4067

Closed
rrelyea opened this Issue Dec 7, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@rrelyea
Contributor

rrelyea commented Dec 7, 2016

Port of dotnet/project-system#896

Repro Steps
Copy the project from \scratch2\scratch\jinuj\TestSceanrio\VSMigrationDemo.zip
Unzip to your machine
open the VSMigrationDemo\VSMigrationDemo.sln file
Accept all the migration notification.
Expected
Project migrated successfully
Actual

Log says
System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at NuGet.PackageManagement.VisualStudio.VSSolutionManager.<<get_IsSolutionFullyLoaded>b__67_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.JoinableTask1.CompleteOnCurrentThread() at Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func1 asyncMethod, JoinableTaskCreationOptions creationOptions)
at NuGet.PackageManagement.VisualStudio.VSSolutionManager.get_IsSolutionFullyLoaded()
at NuGet.PackageManagement.VisualStudio.SolutionRestoreWorker.d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.b__0()
at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.b__0()
at GuardMethodClass.GuardMethod(Func1 , Func2 , Func2 ) --- End of inner exception stack trace --- ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object. at NuGet.PackageManagement.VisualStudio.VSSolutionManager.<<get_IsSolutionFullyLoaded>b__67_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.JoinableTask1.CompleteOnCurrentThread()
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func1 asyncMethod, JoinableTaskCreationOptions creationOptions) at NuGet.PackageManagement.VisualStudio.VSSolutionManager.get_IsSolutionFullyLoaded() at NuGet.PackageManagement.VisualStudio.SolutionRestoreWorker.d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex) at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.b__0() at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.b__0() at GuardMethodClass.GuardMethod(Func1 , Func2 , Func2 )<---
Found in Build
d15rel/15.0.26006.0

@rrelyea rrelyea added this to the 4.0 RC2 milestone Dec 7, 2016

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Dec 7, 2016

Contributor

Assuming RC2 for now. have question out to @srivatsn to understand RC2 v RC3

Contributor

rrelyea commented Dec 7, 2016

Assuming RC2 for now. have question out to @srivatsn to understand RC2 v RC3

@rrelyea rrelyea referenced this issue in dotnet/project-system Dec 7, 2016

Closed

Migration Throws "Object reference Exception " #896

@alpaix

This comment has been minimized.

Show comment
Hide comment
@alpaix

alpaix Dec 7, 2016

The root cause of the issue is incomplete initialization of NuGet components at the time of the migration as the solution is not fully loaded yet. @jainaashish's fix NuGet/NuGet.Client#1047 will resolve this as well.

alpaix commented Dec 7, 2016

The root cause of the issue is incomplete initialization of NuGet components at the time of the migration as the solution is not fully loaded yet. @jainaashish's fix NuGet/NuGet.Client#1047 will resolve this as well.

@rrelyea rrelyea modified the milestones: 4.0 RC3, 4.0 RC2 Dec 7, 2016

@rrelyea rrelyea assigned jainaashish and unassigned alpaix Dec 12, 2016

@jainaashish

This comment has been minimized.

Show comment
Hide comment
@jainaashish

jainaashish Dec 13, 2016

Contributor

Fixed with #PR NuGet/NuGet.Client#1047

Contributor

jainaashish commented Dec 13, 2016

Fixed with #PR NuGet/NuGet.Client#1047

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