dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

"View In Object Browser" does not work for project references #403

Open davkean opened 8 years ago

davkean commented 8 years ago

image

abpiskunov commented 7 years ago

For project context menu shows up but they are not opening in the Object Browser. Assemblies do open. Keeping this issue open until figure out why projects not showing up, it might be in CPS..

davkean commented 7 years ago

COM references also don't open. Interestingly enough they do open if I've already opened them in the legacy project system.

abpiskunov commented 7 years ago

Related https://github.com/dotnet/project-system/issues/1256 - root cause is the same we need our own command handler and can't rely on default CPS one, since it is tied to their References node implementation

davkean commented 7 years ago

This experience has gotten worse in 15.3, attempting to view in browser know shows this:


---------------------------
Microsoft Visual Studio
---------------------------
Value cannot be null.

Parameter name: unresolvedReference
---------------------------
OK   
---------------------------

@srivatsn I'd consider pulling this back in as it's been regressed - before you couldn't view them, now you can and you get basically an exception shown in a dialog.

davkean commented 7 years ago

This looks related to https://github.com/dotnet/project-system/issues/2399,

davkean commented 7 years ago

This looks pretty unprofessional - and is a regression.

abpiskunov commented 7 years ago

Yes, it looks like regression from rtm, however it was never implemented on our side and i thought we would do it in 15.3. I pointed in cps implementation to port in related issue and discussed with Nat. It just need to be prioritized ...

RobertK66 commented 5 years ago

I really can't believe this still be open😞. I am using 15.9.4 and we have 2019 now! When opening building and running an old console application (net-framework 4.6...) and then double clicking the nuget package in project view it shows: image Opening the Object browser (with other reference) shows that the package namespace is loaded perfectly there! This also happens if I make 1.) new project (framework 4.7.) 2.) add nuget package xy 3.) choose 'package reference in project file' 4.) reference is shown as blue nuget icon -> same message as above.

Using your own packages.config shows a black icon and doubleclick works as expected.

Let me agree with your statement from 2017:

This looks pretty unprofessional - and is a regression.

RobertK66 commented 5 years ago

Sorry for the 'unassignment'. Don't know why this happened ......

drewnoakes commented 5 years ago

Related: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/684938

drewnoakes commented 5 years ago

Screenshot from #2399:

image

drewnoakes commented 5 years ago

Double clicking a project reference can also trigger this.

image

Seen in a console app with a project reference. Both have the same target frameworks (netstandard2.0;netstandard1.6) and the exception's only thrown when double-clicking a project reference under netstandard2.0. For netstandard1.6 there's no exception. In both cases, right-click Properties works fine. This may be a different symptom of the same underlying issue.

Stack trace of exception:

at Microsoft.Requires.NotNull[T](T value, String parameterName)
at Microsoft.VisualStudio.ProjectSystem.References.ResolvableReferencesProviderBase`2.<GetResolvedReferenceAsync>d__32.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.VisualStudio.ProjectSystem.References.ResolvableReferencesProviderBase`2.GetResolvedReferenceAsync(TUnresolvedReference unresolvedReference)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Commands.DefaultVsUIHierarchyWindowCmdsHandler.<GetReferenceAsync>d__38.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(Object stateMachine)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass4_0.<OutputAsyncCausalityEvents>b__0()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
at System.Runtime.CompilerServices.TaskAwaiter.<>c__DisplayClass11_0.<OutputWaitEtwEvents>b__0()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction(Object state)
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(Task task, Boolean canInlineContinuationTask)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.FinishStageThree()
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result)
at Microsoft.VisualStudio.ProjectSystem.References.ResolvableReferencesProviderBase`2.<GetUnresolvedReferenceByPathAsync>d__49.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(Object stateMachine)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass4_0.<OutputAsyncCausalityEvents>b__0()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
at System.Runtime.CompilerServices.TaskAwaiter.<>c__DisplayClass11_0.<OutputWaitEtwEvents>b__0()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction(Object state)
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(Task task, Boolean canInlineContinuationTask)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.FinishStageThree()
at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result)
at Microsoft.VisualStudio.ProjectSystem.ProjectItemProviderBase`1.<GetItemsByPathAsync>d__90.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(Object stateMachine)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c__DisplayClass4_0.<OutputAsyncCausalityEvents>b__0()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
at System.Runtime.CompilerServices.TaskAwaiter.<>c__DisplayClass11_0.<OutputWaitEtwEvents>b__0()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.<>c__DisplayClass6_0.<GetActionLogDelegate>b__0()
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.<>c.<.cctor>b__8_0(Object state)
at Microsoft.VisualStudio.Threading.JoinableTaskFactory.SingleExecuteProtector.TryExecute()
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 Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod)
at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.ExecuteSynchronously[T](Func`1 asyncAction)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass568_0.<HrInvoke>b__0()
at Microsoft.VisualStudio.ProjectSystem.VS.HResult.Invoke(Func`1 action, IServiceProvider vsShellServiceProvider, IProjectFaultHandlerService projectFaultHandlerService, UnconfiguredProject project)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.HrInvoke(Func`1 asyncAction, Boolean registerProjectFaultHandlerService)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.ExecCommand(UInt32 itemId, Guid& guidCmdGroup, UInt32 nCmdId, UInt32 nCmdExecOpt, IntPtr pvain, IntPtr p)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNodeWrapper.ExecCommand(UInt32 itemid, Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
at Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy.ExecCommand(UInt32 itemid, Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
at Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities.<>c__DisplayClass35_0.<ExecHierParentChain>b__1()
at Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(Func`1 method, Boolean reportError, Boolean setShellErrorInfo)
at Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities.ExecHierParentChain(IVsHierarchyItemManager manager, IVsUIHierarchy lpUIHCmd, IVsUIHierarchy lpUIHCurrent, UInt32 itemidCurrent, Guid& pguidCmdGroupRef, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.HierarchyInvocationController.Invoke(IEnumerable`1 items, InputSource inputSource, Boolean preview)
at Microsoft.Internal.VisualStudio.PlatformUI.InvocationController.Invoke(IEnumerable`1 items, InputSource inputSource, Boolean preview, Func`2 getController)
at Microsoft.Internal.VisualStudio.PlatformUI.InvocationController.Invoke(IEnumerable`1 items, InputSource inputSource, Boolean preview)
at Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeViewItem.InvokeItem(InputDevice sourceDevice)
at Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeViewItem.OnMouseLeftButtonDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
Konard commented 5 years ago

@drewnoakes how did you get the stack trace? I have the same problem when I double click the project's reference.

drewnoakes commented 5 years ago

@Konard I probably attached another instance of Visual Studio and enabled breaking on all exceptions.

drewnoakes commented 4 years ago

I no longer see an error when selecting "View in Object Browser" on a project reference node. The Object Browser does appear, but nothing meaningful is selected.

Double clicking a project reference can also trigger this

Double clicking now toggles expansion of the tree item.